@thecb/components 6.0.0-beta.5 → 6.0.0-beta.6
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/dist/index.cjs.js +33 -29
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +33 -29
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +14 -5
package/package.json
CHANGED
|
@@ -74,11 +74,10 @@ const DropdownItemWrapper = styled.div`
|
|
|
74
74
|
|
|
75
75
|
const SearchInput = styled.input`
|
|
76
76
|
border: none;
|
|
77
|
-
background-color:
|
|
78
|
-
isOpen ? themeValues.hoverColor && themeValues.hoverColor : "WHITE"};
|
|
77
|
+
background-color: transparent;
|
|
79
78
|
font-size: 16px;
|
|
80
79
|
height: 24px;
|
|
81
|
-
min-width:
|
|
80
|
+
min-width: 80%;
|
|
82
81
|
`;
|
|
83
82
|
|
|
84
83
|
const Dropdown = ({
|
|
@@ -96,7 +95,8 @@ const Dropdown = ({
|
|
|
96
95
|
disabled,
|
|
97
96
|
hasTitles = false,
|
|
98
97
|
autoEraseTypeAhead = true, // legacy behavior as of 05/22
|
|
99
|
-
ariaLabelledby
|
|
98
|
+
ariaLabelledby,
|
|
99
|
+
autocompleteValue = "" // autofill item for browsers, like country-name or address-level1 for state
|
|
100
100
|
}) => {
|
|
101
101
|
const [inputValue, setInputValue] = useState("");
|
|
102
102
|
const [optionsState, setOptionsState] = useState([]);
|
|
@@ -221,6 +221,8 @@ const Dropdown = ({
|
|
|
221
221
|
!disabledValues.includes(filteredOptions[0].value) &&
|
|
222
222
|
filteredOptions[0].text != placeholder
|
|
223
223
|
) {
|
|
224
|
+
console.log("filtered options are", filteredOptions);
|
|
225
|
+
console.log("option refs are", optionRefs);
|
|
224
226
|
onSelect(filteredOptions[0].value);
|
|
225
227
|
}
|
|
226
228
|
if (optionRefs.current[0].current) {
|
|
@@ -274,7 +276,11 @@ const Dropdown = ({
|
|
|
274
276
|
pointer-events: none;`}
|
|
275
277
|
`}
|
|
276
278
|
>
|
|
277
|
-
<Stack
|
|
279
|
+
<Stack
|
|
280
|
+
direction="row"
|
|
281
|
+
bottomItem={2}
|
|
282
|
+
extraStyles={`position: relative;`}
|
|
283
|
+
>
|
|
278
284
|
<SearchInput
|
|
279
285
|
aria-label={getSelection()}
|
|
280
286
|
placeholder={getSelection()}
|
|
@@ -288,6 +294,9 @@ const Dropdown = ({
|
|
|
288
294
|
aria-controls={`${ariaLabelledby}_listbox`}
|
|
289
295
|
aria-activedescendant="selected_option"
|
|
290
296
|
isOpen={isOpen}
|
|
297
|
+
tabIndex={-1}
|
|
298
|
+
name={autocompleteValue}
|
|
299
|
+
autocomplete={autocompleteValue}
|
|
291
300
|
/>
|
|
292
301
|
<IconWrapper open={isOpen}>
|
|
293
302
|
<DropdownIcon />
|