@trackunit/react-form-components 1.7.27 → 1.7.28

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/index.cjs.js CHANGED
@@ -2551,19 +2551,6 @@ const ReactSyncSelect = ReactSelect.default || ReactSelect;
2551
2551
  const Select = (props) => {
2552
2552
  const { id, dataTestId = "select", prefix, async, maxMenuHeight = 200, label, hasError, disabled, isMulti, menuPosition = "absolute", value, options, onChange, isLoading, classNamePrefix = "select", onMenuScrollToBottom, onInputChange, isSearchable, isClearable = false, readOnly, fieldSize = "medium", openMenuOnClick = !disabled, openMenuOnFocus = false, hideSelectedOptions = false, } = props;
2553
2553
  const { refContainer, customStyles, menuIsOpen, customComponents, menuPlacement, openMenuHandler, closeMenuHandler } = useSelect(props);
2554
- // Control the search input value so it doesn’t reset after selection
2555
- const [inputValue, setInputValue] = react.useState("");
2556
- const handleInputChange = react.useCallback((nextValue, meta) => {
2557
- // Ignore internal actions that clear the input to preserve the typed text
2558
- // and avoid resetting the parent’s search state
2559
- const ignoreActions = new Set(["set-value", "input-blur", "menu-close"]);
2560
- if (ignoreActions.has(meta.action)) {
2561
- return inputValue;
2562
- }
2563
- setInputValue(nextValue);
2564
- onInputChange?.(nextValue, meta);
2565
- return nextValue;
2566
- }, [inputValue, onInputChange]);
2567
2554
  const reactSelectProps = react.useMemo(() => ({
2568
2555
  value,
2569
2556
  menuPlacement,
@@ -2592,8 +2579,7 @@ const Select = (props) => {
2592
2579
  isClearable,
2593
2580
  id,
2594
2581
  onMenuScrollToBottom,
2595
- onInputChange: handleInputChange,
2596
- inputValue,
2582
+ onInputChange,
2597
2583
  hideSelectedOptions,
2598
2584
  isDisabled: Boolean(disabled),
2599
2585
  }), [
@@ -2602,10 +2588,8 @@ const Select = (props) => {
2602
2588
  customStyles,
2603
2589
  dataTestId,
2604
2590
  disabled,
2605
- handleInputChange,
2606
2591
  hideSelectedOptions,
2607
2592
  id,
2608
- inputValue,
2609
2593
  isClearable,
2610
2594
  isLoading,
2611
2595
  isMulti,
@@ -2615,6 +2599,7 @@ const Select = (props) => {
2615
2599
  menuIsOpen,
2616
2600
  menuPlacement,
2617
2601
  onChange,
2602
+ onInputChange,
2618
2603
  onMenuScrollToBottom,
2619
2604
  openMenuOnClick,
2620
2605
  openMenuOnFocus,
package/index.esm.js CHANGED
@@ -2550,19 +2550,6 @@ const ReactSyncSelect = ReactSelect.default || ReactSelect;
2550
2550
  const Select = (props) => {
2551
2551
  const { id, dataTestId = "select", prefix, async, maxMenuHeight = 200, label, hasError, disabled, isMulti, menuPosition = "absolute", value, options, onChange, isLoading, classNamePrefix = "select", onMenuScrollToBottom, onInputChange, isSearchable, isClearable = false, readOnly, fieldSize = "medium", openMenuOnClick = !disabled, openMenuOnFocus = false, hideSelectedOptions = false, } = props;
2552
2552
  const { refContainer, customStyles, menuIsOpen, customComponents, menuPlacement, openMenuHandler, closeMenuHandler } = useSelect(props);
2553
- // Control the search input value so it doesn’t reset after selection
2554
- const [inputValue, setInputValue] = useState("");
2555
- const handleInputChange = useCallback((nextValue, meta) => {
2556
- // Ignore internal actions that clear the input to preserve the typed text
2557
- // and avoid resetting the parent’s search state
2558
- const ignoreActions = new Set(["set-value", "input-blur", "menu-close"]);
2559
- if (ignoreActions.has(meta.action)) {
2560
- return inputValue;
2561
- }
2562
- setInputValue(nextValue);
2563
- onInputChange?.(nextValue, meta);
2564
- return nextValue;
2565
- }, [inputValue, onInputChange]);
2566
2553
  const reactSelectProps = useMemo(() => ({
2567
2554
  value,
2568
2555
  menuPlacement,
@@ -2591,8 +2578,7 @@ const Select = (props) => {
2591
2578
  isClearable,
2592
2579
  id,
2593
2580
  onMenuScrollToBottom,
2594
- onInputChange: handleInputChange,
2595
- inputValue,
2581
+ onInputChange,
2596
2582
  hideSelectedOptions,
2597
2583
  isDisabled: Boolean(disabled),
2598
2584
  }), [
@@ -2601,10 +2587,8 @@ const Select = (props) => {
2601
2587
  customStyles,
2602
2588
  dataTestId,
2603
2589
  disabled,
2604
- handleInputChange,
2605
2590
  hideSelectedOptions,
2606
2591
  id,
2607
- inputValue,
2608
2592
  isClearable,
2609
2593
  isLoading,
2610
2594
  isMulti,
@@ -2614,6 +2598,7 @@ const Select = (props) => {
2614
2598
  menuIsOpen,
2615
2599
  menuPlacement,
2616
2600
  onChange,
2601
+ onInputChange,
2617
2602
  onMenuScrollToBottom,
2618
2603
  openMenuOnClick,
2619
2604
  openMenuOnFocus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "1.7.27",
3
+ "version": "1.7.28",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {