Skip to content

Commit e1df45e

Browse files
committed
fix: selector check all filter disabled
1 parent 95268fd commit e1df45e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ yarn.lock
1111
.sass-cache
1212
gh_pages
1313
_site
14-
node_modules
14+
**/node_modules
1515
/dist
1616
/lib
1717
**/esm

examples/components/Form/Full.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ export default {
675675
label: '多选',
676676
multiple: true,
677677
inline: true,
678+
checkAll: true,
678679
options: [
679680
{
680681
label: '选项1',
@@ -683,6 +684,11 @@ export default {
683684
{
684685
label: '选项2',
685686
value: 2
687+
},
688+
{
689+
label: '选项3',
690+
value: 3,
691+
disabled: true
686692
}
687693
]
688694
},

packages/amis-ui/src/components/Select.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,13 @@ export class Select extends React.Component<SelectProps, SelectState> {
611611

612612
const inputValue = this.state.inputValue;
613613
let {selection} = this.state;
614-
let filtedOptions: Array<Option> =
614+
let filtedOptions: Array<Option> = (
615615
inputValue && checkAllBySearch !== false
616616
? filterOption(options, inputValue, {
617617
keys: [labelField || 'label', valueField || 'value']
618618
})
619-
: options.concat();
619+
: options.concat()
620+
).filter(option => option && !option.disabled);
620621
const optionsValues = filtedOptions.map(option => option.value);
621622
const selectionValues = selection.map(select => select.value);
622623
const checkedAll = optionsValues.every(

0 commit comments

Comments
 (0)