michael-s-molina commented on a change in pull request #18799:
URL: https://github.com/apache/superset/pull/18799#discussion_r817635382



##########
File path: superset-frontend/src/components/Select/Select.tsx
##########
@@ -510,40 +504,55 @@ const Select = ({
         .catch(internalOnError)
         .finally(() => {
           setIsLoading(false);
-          setIsTyping(false);
         });
     },
-    [allValuesLoaded, fetchOnlyOnSearch, handleData, internalOnError, options],
+    [
+      allValuesLoaded,
+      fetchOnlyOnSearch,
+      handleData,
+      internalOnError,
+      options,
+      pageSize,
+    ],
   );
 
-  const handleOnSearch = useMemo(
+  const debouncedHandleSearch = useMemo(
     () =>
       debounce((search: string) => {
-        const searchValue = search.trim();
-        if (allowNewOptions && isSingleMode) {
-          const newOption = searchValue &&
-            !hasOption(searchValue, selectOptions) && {
-              label: searchValue,
-              value: searchValue,
-            };
-          const newOptions = newOption
-            ? [
-                newOption,
-                ...selectOptions.filter(opt => opt.value !== searchedValue),
-              ]
-            : [...selectOptions.filter(opt => opt.value !== searchedValue)];
-
-          setSelectOptions(newOptions);
-        }
-
-        if (!searchValue || searchValue === searchedValue) {
-          setIsTyping(false);
-        }
-        setSearchedValue(searchValue);
-      }, DEBOUNCE_TIMEOUT),
-    [allowNewOptions, isSingleMode, searchedValue, selectOptions],
+        // async search will triggered in handlePaginatedFetch

Review comment:
       ```suggestion
           // async search will be triggered in handlePaginatedFetch
   ```

##########
File path: superset-frontend/src/components/Select/Select.tsx
##########
@@ -57,18 +57,12 @@ type PickedSelectProps = Pick<
   | 'notFoundContent'
   | 'onChange'
   | 'onClear'
-  | 'onFocus'

Review comment:
       Why did you remove the `onFocus` prop? It's being used by 
`SelectControl`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to