@pallasoft/ps-input-components 3.9.0 → 3.9.1
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.
|
@@ -6,7 +6,13 @@ const react_aria_components_1 = require("react-aria-components");
|
|
|
6
6
|
const PsComboboxCloseBridge = ({ closeRef }) => {
|
|
7
7
|
const state = (0, react_1.useContext)(react_aria_components_1.ComboBoxStateContext);
|
|
8
8
|
(0, react_1.useEffect)(() => {
|
|
9
|
-
closeRef.current =
|
|
9
|
+
closeRef.current =
|
|
10
|
+
state === null
|
|
11
|
+
? null
|
|
12
|
+
: () => {
|
|
13
|
+
if (state.isOpen)
|
|
14
|
+
state.toggle();
|
|
15
|
+
};
|
|
10
16
|
}, [closeRef, state]);
|
|
11
17
|
return null;
|
|
12
18
|
};
|
|
@@ -3,7 +3,13 @@ import { ComboBoxStateContext } from 'react-aria-components';
|
|
|
3
3
|
export const PsComboboxCloseBridge = ({ closeRef }) => {
|
|
4
4
|
const state = useContext(ComboBoxStateContext);
|
|
5
5
|
useEffect(() => {
|
|
6
|
-
closeRef.current =
|
|
6
|
+
closeRef.current =
|
|
7
|
+
state === null
|
|
8
|
+
? null
|
|
9
|
+
: () => {
|
|
10
|
+
if (state.isOpen)
|
|
11
|
+
state.toggle();
|
|
12
|
+
};
|
|
7
13
|
}, [closeRef, state]);
|
|
8
14
|
return null;
|
|
9
15
|
};
|