@homebound/beam 2.266.0 → 2.266.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.
|
@@ -133,11 +133,10 @@ function ComboBoxBase(props) {
|
|
|
133
133
|
maybeInitLoad();
|
|
134
134
|
firstOpen.current = false;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}));
|
|
136
|
+
// When using the multiselect field, always empty the input upon open.
|
|
137
|
+
if (multiselect && isOpen) {
|
|
138
|
+
setFieldState((prevState) => ({ ...prevState, inputValue: "" }));
|
|
139
|
+
}
|
|
141
140
|
}
|
|
142
141
|
// Used to calculate the rendered width of the combo box (input + button)
|
|
143
142
|
const comboBoxRef = (0, react_1.useRef)(null);
|
|
@@ -163,6 +162,9 @@ function ComboBoxBase(props) {
|
|
|
163
162
|
const state = (0, react_stately_1.useComboBoxState)({
|
|
164
163
|
...comboBoxProps,
|
|
165
164
|
allowsEmptyCollection: true,
|
|
165
|
+
// We don't really allow custom values, as we reset the input value once a user `blur`s the input field.
|
|
166
|
+
// Though, setting `allowsCustomValue: true` prevents React-Aria/Stately from attempting to reset the input field's value when the menu closes.
|
|
167
|
+
allowsCustomValue: true,
|
|
166
168
|
// useComboBoxState.onSelectionChange will be executed if a keyboard interaction (Enter key) is used to select an item
|
|
167
169
|
onSelectionChange: (key) => {
|
|
168
170
|
// ignore undefined/null keys - `null` can happen if input field's value is completely deleted after having a value assigned.
|