@thecb/components 6.0.0-beta.22 → 6.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -20894,9 +20894,19 @@ var Dropdown = function Dropdown(_ref8) {
20894
20894
  }));
20895
20895
  }, [inputValue]);
20896
20896
  useEffect$1(function () {
20897
- if ((!isOpen || inputChangedByAutofill) && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
20897
+ if (
20898
+ /*
20899
+ Either user has typed a value into input that matches a non-disabled option
20900
+ or
20901
+ user has autofilled or pasted into input a string matching a valid option
20902
+ */
20903
+ (!isOpen || inputChangedByAutofill) && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
20898
20904
  setInputChangedByAutofill(false);
20899
20905
  onSelect(filteredOptions[0].value);
20906
+
20907
+ if (isOpen) {
20908
+ _onClick();
20909
+ }
20900
20910
  }
20901
20911
 
20902
20912
  if (optionRefs.current[0].current) {