fix(dashboard,ui): Fixes to Combobox and CategoryCombobox (#9537)
**What** - Fixes the Combobox to keep the width of the content constant. - Brings CategoryCombobox inline with the other Combobox component - Adds keyboard navigation to the CategoryCombobox: You can now navigate options using ArrowUp and ArrowDown, and if an option has children you can use ArrowRight to see the children options. - Add "outline-none" to the Drawer component to stop it from flashing whenever focus is dropped. - Removes a dependency that was added to the UI package by mistake Resolves CC-155
This commit is contained in:
@@ -76,13 +76,13 @@ export const useComboboxData = <
|
||||
*/
|
||||
const disabled = !rest.isPending && !options.length && !searchValue
|
||||
|
||||
// // make sure that the default value is included in the option, if its not in options already
|
||||
if (
|
||||
defaultValue &&
|
||||
defaultOptions.length &&
|
||||
!options.find((o) => o.value === defaultValue)
|
||||
) {
|
||||
options.unshift(defaultOptions[0])
|
||||
// make sure that the default value is included in the options
|
||||
if (defaultValue && defaultOptions.length && !searchValue) {
|
||||
defaultOptions.forEach((option) => {
|
||||
if (!options.find((o) => o.value === option.value)) {
|
||||
options.unshift(option)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user