@thecb/components 6.0.0-beta.8 → 6.0.0-beta.9
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 +12 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -16
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +40 -55
package/package.json
CHANGED
|
@@ -122,7 +122,8 @@ const Dropdown = ({
|
|
|
122
122
|
value ? options.find(option => option.value === value)?.text : placeholder;
|
|
123
123
|
|
|
124
124
|
const onKeyDown = e => {
|
|
125
|
-
console.log("key down event is", e);
|
|
125
|
+
console.log("key down event is", e.target);
|
|
126
|
+
console.log("key down event value is", e.target.value);
|
|
126
127
|
const { key, keyCode } = e;
|
|
127
128
|
const focus = document.activeElement;
|
|
128
129
|
console.log("dropdown value is", value);
|
|
@@ -238,9 +239,10 @@ const Dropdown = ({
|
|
|
238
239
|
<Box
|
|
239
240
|
onKeyDown={onKeyDown}
|
|
240
241
|
onClick={onClick}
|
|
241
|
-
padding="
|
|
242
|
+
padding="12px"
|
|
242
243
|
width="100%"
|
|
243
244
|
hoverStyles={`background-color: ${themeValues.hoverColor};`}
|
|
245
|
+
background={isOpen ? themeValues.hoverColor : WHITE}
|
|
244
246
|
aria-expanded={isOpen}
|
|
245
247
|
role="combobox"
|
|
246
248
|
aria-owns={`${ariaLabelledby}_listbox`}
|
|
@@ -253,60 +255,43 @@ const Dropdown = ({
|
|
|
253
255
|
pointer-events: none;`
|
|
254
256
|
}
|
|
255
257
|
title={hasTitles ? getSelection() : null}
|
|
258
|
+
dataQa={placeholder}
|
|
259
|
+
tabIndex={0}
|
|
260
|
+
borderRadius="2px"
|
|
261
|
+
borderSize="1px"
|
|
262
|
+
borderColor={
|
|
263
|
+
isError
|
|
264
|
+
? ERROR_COLOR
|
|
265
|
+
: isOpen
|
|
266
|
+
? themeValues.selectedColor
|
|
267
|
+
: GREY_CHATEAU
|
|
268
|
+
}
|
|
256
269
|
>
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
direction="row"
|
|
283
|
-
bottomItem={2}
|
|
284
|
-
extraStyles={`position: relative;`}
|
|
285
|
-
>
|
|
286
|
-
<SearchInput
|
|
287
|
-
aria-label={getSelection()}
|
|
288
|
-
placeholder={getSelection()}
|
|
289
|
-
value={inputValue}
|
|
290
|
-
onChange={e => {
|
|
291
|
-
console.log("input change event", e);
|
|
292
|
-
}}
|
|
293
|
-
themeValues={themeValues}
|
|
294
|
-
role="searchbox"
|
|
295
|
-
type="text"
|
|
296
|
-
aria-multiline="false"
|
|
297
|
-
aria-autocomplete="list"
|
|
298
|
-
aria-controls={`${ariaLabelledby}_listbox`}
|
|
299
|
-
aria-activedescendant="selected_option"
|
|
300
|
-
isOpen={isOpen}
|
|
301
|
-
tabIndex={-1}
|
|
302
|
-
name={autocompleteValue}
|
|
303
|
-
autocomplete={autocompleteValue}
|
|
304
|
-
/>
|
|
305
|
-
<IconWrapper open={isOpen}>
|
|
306
|
-
<DropdownIcon />
|
|
307
|
-
</IconWrapper>
|
|
308
|
-
</Stack>
|
|
309
|
-
</Box>
|
|
270
|
+
<Stack direction="row" bottomItem={2} extraStyles={`position: relative;`}>
|
|
271
|
+
<SearchInput
|
|
272
|
+
aria-label={getSelection()}
|
|
273
|
+
placeholder={getSelection()}
|
|
274
|
+
value={inputValue}
|
|
275
|
+
onChange={e => {
|
|
276
|
+
console.log("input change event", e.target);
|
|
277
|
+
console.log("input change event value", e.target.value);
|
|
278
|
+
}}
|
|
279
|
+
themeValues={themeValues}
|
|
280
|
+
role="searchbox"
|
|
281
|
+
type="text"
|
|
282
|
+
aria-multiline="false"
|
|
283
|
+
aria-autocomplete="list"
|
|
284
|
+
aria-controls={`${ariaLabelledby}_listbox`}
|
|
285
|
+
aria-activedescendant="selected_option"
|
|
286
|
+
isOpen={isOpen}
|
|
287
|
+
tabIndex={-1}
|
|
288
|
+
name={autocompleteValue}
|
|
289
|
+
autocomplete={autocompleteValue}
|
|
290
|
+
/>
|
|
291
|
+
<IconWrapper open={isOpen}>
|
|
292
|
+
<DropdownIcon />
|
|
293
|
+
</IconWrapper>
|
|
294
|
+
</Stack>
|
|
310
295
|
{isOpen ? (
|
|
311
296
|
<DropdownContentWrapper
|
|
312
297
|
maxHeight={maxHeight}
|