Database diagrams editor that allows you to visualize and design your DB with a single query.
TypeScript databasedbdb-migrationeditorerdmariadbmssqlmysqlpostgresqlreactreact-flowschema-migrationssqlsqlitetypescriptvisualizationxyflow
fix(select-box): allow using tab & space to show choices (#336)
Francis Chartrand93f623a13a61
diff --git a/src/components/select-box/select-box.tsx b/src/components/select-box/select-box.tsxindex 62930b3f..a76055cb 100644--- a/src/components/select-box/select-box.tsx+++ b/src/components/select-box/select-box.tsx@@ -156,9 +156,19 @@ export const SelectBox = React.forwardRef<HTMLInputElement, SelectBoxProps>([options, value, multiple]);+ const handleKeyDown = React.useCallback(+ (e: React.KeyboardEvent) => {+ if (!isOpen && e.code.toLowerCase() === 'space') {+ e.preventDefault();+ onOpenChange(true);+ }+ },+ [isOpen, onOpenChange]+ );+return (<Popover open={isOpen} onOpenChange={onOpenChange} modal={true}>- <PopoverTrigger asChild>+ <PopoverTrigger asChild tabIndex={0} onKeyDown={handleKeyDown}><divclassName={cn(`flex min-h-[36px] cursor-pointer items-center justify-between rounded-md border px-3 py-1 data-[state=open]:border-ring ${disabled ? 'bg-muted pointer-events-none' : ''}`,