From 012657ef8e0af9a92d21956f47c1c5c7cb34219d Mon Sep 17 00:00:00 2001 From: Batuhan Tomo Date: Tue, 30 Apr 2024 10:32:15 +0300 Subject: [PATCH 1/2] Fix #6499: Refactor --- components/lib/listbox/ListBox.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/components/lib/listbox/ListBox.js b/components/lib/listbox/ListBox.js index 98ea380a2e..ae40b4b85f 100644 --- a/components/lib/listbox/ListBox.js +++ b/components/lib/listbox/ListBox.js @@ -384,7 +384,7 @@ export const ListBox = React.memo( const len = target.value.length; target.setSelectionRange(len, len); - focusedOptionIndex = -1; + setFocusedOptionIndex(-1) ; } else { let metaKey = event.metaKey || event.ctrlKey; let optionIndex = findLastOptionIndex(); @@ -580,13 +580,6 @@ export const ListBox = React.memo( return isEquals(props.value, optionValue); }; - const filter = (option) => { - const filterValue = filteredValue.trim().toLocaleLowerCase(props.filterLocale); - const optionLabel = getOptionLabel(option).toLocaleLowerCase(props.filterLocale); - - return optionLabel.indexOf(filterValue) > -1; - }; - const getOptionLabel = (option) => { return props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : option && option.label !== undefined ? option.label : option; }; @@ -638,7 +631,7 @@ export const ListBox = React.memo( autoUpdateModel(true); }; - const onListBlur = (event) => { + const onListBlur = () => { setFocused(false); setFocusedOptionIndex(-1); setStartRangeIndex(-1); From ecbc3e31c2e9e1c33fa042c684aa8bfac78ee46e Mon Sep 17 00:00:00 2001 From: Batuhan Tomo Date: Tue, 30 Apr 2024 10:35:47 +0300 Subject: [PATCH 2/2] Fix #6499: update --- components/lib/listbox/ListBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/listbox/ListBox.js b/components/lib/listbox/ListBox.js index ae40b4b85f..908fe2ef7a 100644 --- a/components/lib/listbox/ListBox.js +++ b/components/lib/listbox/ListBox.js @@ -384,7 +384,7 @@ export const ListBox = React.memo( const len = target.value.length; target.setSelectionRange(len, len); - setFocusedOptionIndex(-1) ; + setFocusedOptionIndex(-1); } else { let metaKey = event.metaKey || event.ctrlKey; let optionIndex = findLastOptionIndex();