Skip to content

Commit

Permalink
Fixed LabeledSelect not emitting search explicitly (#13142)
Browse files Browse the repository at this point in the history
  • Loading branch information
eva-vashkevich authored Jan 17, 2025
1 parent ba68adb commit beef20e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shell/components/auth/SelectPrincipal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default {
}
},
onSearch(str, loading, vm) {
onSearch(str, loading) {
str = (str || '').trim();
this.searchStr = str;
Expand Down
5 changes: 3 additions & 2 deletions shell/components/form/LabeledSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
LabeledSelectPagination
],
emits: ['on-open', 'on-close', 'selecting', 'deselecting', 'update:validation', 'update:value'],
emits: ['on-open', 'on-close', 'selecting', 'deselecting', 'search', 'update:validation', 'update:value'],
props: {
appendToBody: {
Expand Down Expand Up @@ -238,14 +238,15 @@ export default {
return noDrop ? false : open && shouldOpen && !mutableLoading;
},
onSearch(newSearchString) {
onSearch(newSearchString, loading) {
if (this.canPaginate) {
this.setPaginationFilter(newSearchString);
} else {
if (newSearchString) {
this.dropdownShouldOpen(this.$refs['select-input'], true);
}
}
this.$emit('search', newSearchString, loading);
},
getOptionKey(opt) {
Expand Down

0 comments on commit beef20e

Please sign in to comment.