@itwin/itwinui-react 2.12.19 → 2.12.20
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/CHANGELOG.md
CHANGED
|
@@ -34,7 +34,7 @@ const index_js_2 = require("../utils/index.js");
|
|
|
34
34
|
const ComboBoxMultipleContainer_js_1 = require("./ComboBoxMultipleContainer.js");
|
|
35
35
|
const helpers_js_1 = require("./helpers.js");
|
|
36
36
|
exports.ComboBoxInput = React.forwardRef((props, forwardedRef) => {
|
|
37
|
-
const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, ...rest } = props;
|
|
37
|
+
const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, style, ...rest } = props;
|
|
38
38
|
const { isOpen, id, focusedIndex, enableVirtualization, multiple, onClickHandler, } = (0, index_js_2.useSafeContext)(helpers_js_1.ComboBoxStateContext);
|
|
39
39
|
const dispatch = (0, index_js_2.useSafeContext)(helpers_js_1.ComboBoxActionContext);
|
|
40
40
|
const { inputRef, menuRef, optionsExtraInfoRef } = (0, index_js_2.useSafeContext)(helpers_js_1.ComboBoxRefsContext);
|
|
@@ -159,7 +159,10 @@ exports.ComboBoxInput = React.forwardRef((props, forwardedRef) => {
|
|
|
159
159
|
return (React.createElement(React.Fragment, null,
|
|
160
160
|
React.createElement(index_js_1.Input, { ref: refs, onKeyDown: handleKeyDown, onClick: (0, index_js_2.mergeEventHandlers)(onClickProp, handleClick), onFocus: handleFocus, "aria-activedescendant": isOpen && focusedIndex != undefined && focusedIndex > -1
|
|
161
161
|
? getIdFromIndex(focusedIndex)
|
|
162
|
-
: undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style:
|
|
162
|
+
: undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style: {
|
|
163
|
+
...(multiple && { paddingInlineStart: tagContainerWidth + 18 }),
|
|
164
|
+
...style,
|
|
165
|
+
}, "aria-describedby": multiple ? `${id}-selected-live` : undefined, ...rest }),
|
|
163
166
|
multiple && selectTags ? (React.createElement(ComboBoxMultipleContainer_js_1.ComboBoxMultipleContainer, { ref: tagContainerWidthRef, selectedItems: selectTags, id: `${id}-selected-live` })) : null));
|
|
164
167
|
});
|
|
165
168
|
exports.ComboBoxInput.displayName = 'ComboBoxInput';
|
|
@@ -8,7 +8,7 @@ import { useSafeContext, useMergedRefs, useContainerWidth, mergeEventHandlers, }
|
|
|
8
8
|
import { ComboBoxMultipleContainer } from './ComboBoxMultipleContainer.js';
|
|
9
9
|
import { ComboBoxStateContext, ComboBoxActionContext, ComboBoxRefsContext, } from './helpers.js';
|
|
10
10
|
export const ComboBoxInput = React.forwardRef((props, forwardedRef) => {
|
|
11
|
-
const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, ...rest } = props;
|
|
11
|
+
const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, style, ...rest } = props;
|
|
12
12
|
const { isOpen, id, focusedIndex, enableVirtualization, multiple, onClickHandler, } = useSafeContext(ComboBoxStateContext);
|
|
13
13
|
const dispatch = useSafeContext(ComboBoxActionContext);
|
|
14
14
|
const { inputRef, menuRef, optionsExtraInfoRef } = useSafeContext(ComboBoxRefsContext);
|
|
@@ -133,7 +133,10 @@ export const ComboBoxInput = React.forwardRef((props, forwardedRef) => {
|
|
|
133
133
|
return (React.createElement(React.Fragment, null,
|
|
134
134
|
React.createElement(Input, { ref: refs, onKeyDown: handleKeyDown, onClick: mergeEventHandlers(onClickProp, handleClick), onFocus: handleFocus, "aria-activedescendant": isOpen && focusedIndex != undefined && focusedIndex > -1
|
|
135
135
|
? getIdFromIndex(focusedIndex)
|
|
136
|
-
: undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style:
|
|
136
|
+
: undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style: {
|
|
137
|
+
...(multiple && { paddingInlineStart: tagContainerWidth + 18 }),
|
|
138
|
+
...style,
|
|
139
|
+
}, "aria-describedby": multiple ? `${id}-selected-live` : undefined, ...rest }),
|
|
137
140
|
multiple && selectTags ? (React.createElement(ComboBoxMultipleContainer, { ref: tagContainerWidthRef, selectedItems: selectTags, id: `${id}-selected-live` })) : null));
|
|
138
141
|
});
|
|
139
142
|
ComboBoxInput.displayName = 'ComboBoxInput';
|