mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
修复 select 点击新增按钮无效的问题
This commit is contained in:
parent
e486bb3777
commit
8c848613e7
@ -332,6 +332,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||
|
||||
onFocus(e: any) {
|
||||
this.props.disabled ||
|
||||
this.state.isOpen ||
|
||||
this.setState(
|
||||
{
|
||||
isFocused: true
|
||||
@ -537,16 +538,15 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||
);
|
||||
}
|
||||
|
||||
renderOuter(
|
||||
{
|
||||
selectedItem,
|
||||
getItemProps,
|
||||
highlightedIndex,
|
||||
inputValue,
|
||||
isOpen
|
||||
}: ControllerStateAndHelpers<any>,
|
||||
getInputProps: any
|
||||
) {
|
||||
renderOuter({
|
||||
selectedItem,
|
||||
getItemProps,
|
||||
highlightedIndex,
|
||||
inputValue,
|
||||
isOpen,
|
||||
getToggleButtonProps,
|
||||
getInputProps
|
||||
}: ControllerStateAndHelpers<any>) {
|
||||
const {
|
||||
popOverContainer,
|
||||
options,
|
||||
@ -786,7 +786,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||
itemToString={item => (item ? item[labelField] : '')}
|
||||
>
|
||||
{(options: ControllerStateAndHelpers<any>) => {
|
||||
const {isOpen, getInputProps} = options;
|
||||
const {isOpen} = options;
|
||||
return (
|
||||
<div
|
||||
tabIndex={disabled ? -1 : 0}
|
||||
@ -822,7 +822,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||
) : null}
|
||||
|
||||
<span className={cx('Select-arrow')} />
|
||||
{isOpen ? this.renderOuter(options, getInputProps) : null}
|
||||
{isOpen ? this.renderOuter(options) : null}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user