@box/blueprint-web 6.15.1 → 6.15.2

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.
@@ -100,14 +100,7 @@ const RootInner = ({
100
100
  }
101
101
  return getSelectedOptionValues(valueProp);
102
102
  }, [getSelectedOptionValues, valueProp]);
103
- const focusInput = useCallback(() => {
104
- inputRef.current?.focus();
105
- }, []);
106
103
  const setValue = newSelectedValue => {
107
- // Move focus back to input for single selects
108
- if (!Array.isArray(newSelectedValue)) {
109
- focusInput();
110
- }
111
104
  if (!onValueChange) {
112
105
  return;
113
106
  }
@@ -148,6 +141,9 @@ const RootInner = ({
148
141
  },
149
142
  // eslint-disable-next-line react-hooks/exhaustive-deps
150
143
  [displayAvatar]);
144
+ const focusInput = useCallback(() => {
145
+ inputRef.current?.focus();
146
+ }, []);
151
147
  const renderSelectItemOption = useCallback(option => {
152
148
  const value = getOptionValue(option);
153
149
  return jsxs(OptionWithIndicator, {
@@ -166,8 +162,10 @@ const RootInner = ({
166
162
  setInputValue('');
167
163
  } else if (selectedValueMemoized) {
168
164
  setInputValue(getDisplayValueFromOptionValue(selectedValueMemoized));
165
+ // Also focus input for single-select variant
166
+ focusInput();
169
167
  }
170
- }, [selectedValueMemoized, getDisplayValueFromOptionValue, setInputValue]);
168
+ }, [selectedValueMemoized, getDisplayValueFromOptionValue, setInputValue, focusInput]);
171
169
  const handleKeyDown = useCallback(event => {
172
170
  // Close menu
173
171
  if (event.key === 'Enter' || event.key === 'Tab') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "6.15.1",
3
+ "version": "6.15.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -57,7 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@box/storybook-utils": "^0.0.3"
59
59
  },
60
- "gitHead": "1f7ff1dd54e90dd51c1766a4c51ee7da2fd39552",
60
+ "gitHead": "b77c7614e2253ebf37d08f279f8f7490de1f22c0",
61
61
  "module": "lib-esm/index.js",
62
62
  "main": "lib-esm/index.js",
63
63
  "exports": {