mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
Fix search in select dropdown [SCI-12261]
This commit is contained in:
parent
12b911fa55
commit
dabeb0650f
1 changed files with 10 additions and 4 deletions
|
@ -149,7 +149,8 @@ export default {
|
|||
fixedWidth: true,
|
||||
focusedOption: null,
|
||||
skipQueryCallback: false,
|
||||
nextPage: 1
|
||||
nextPage: 1,
|
||||
totalOptionsCount: this.options.length
|
||||
};
|
||||
},
|
||||
mixins: [FixedFlyoutMixin],
|
||||
|
@ -226,11 +227,11 @@ export default {
|
|||
if (this.newValue.length === 0) {
|
||||
return false;
|
||||
}
|
||||
if (this.newValue.length === 1 && this.rawOptions.length > 1) {
|
||||
if (this.newValue.length === 1 && this.totalOptionsCount > 1) {
|
||||
this.selectAllState = 'indeterminate';
|
||||
return this.renderLabel(this.rawOptions.find((option) => option[0] === this.newValue[0]));
|
||||
}
|
||||
if (this.newValue.length === this.rawOptions.length) {
|
||||
if (this.newValue.length === this.totalOptionsCount) {
|
||||
this.selectAllState = 'checked';
|
||||
return this.allOptionsPlaceholder || this.i18n.t('general.select_dropdown.all_options_placeholder');
|
||||
}
|
||||
|
@ -264,7 +265,6 @@ export default {
|
|||
if (!this.newValue && this.multiple) {
|
||||
this.newValue = [];
|
||||
}
|
||||
this.fetchOptions();
|
||||
},
|
||||
watch: {
|
||||
value(newValue) {
|
||||
|
@ -318,6 +318,7 @@ export default {
|
|||
},
|
||||
open() {
|
||||
if (!this.disabled) this.isOpen = true;
|
||||
this.fetchOptions();
|
||||
},
|
||||
clear() {
|
||||
this.newValue = this.multiple ? [] : null;
|
||||
|
@ -391,6 +392,11 @@ export default {
|
|||
} else {
|
||||
this.fetchedOptions = response.data.data;
|
||||
}
|
||||
|
||||
if (this.fetchedOptions.length > this.totalOptionsCount) {
|
||||
this.totalOptionsCount = this.fetchedOptions.length;
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.setPosition();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue