Skip to content

Commit b7839e6

Browse files
committed
Replace checkboxes with radio items for single-select dropdowns
1 parent 1597ee6 commit b7839e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/dash-core-components/src/fragments/Dropdown.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const Dropdown = (props: DropdownProps) => {
289289
}
290290

291291
const focusableElements = e.currentTarget.querySelectorAll(
292-
'input[type="search"], input[type="checkbox"]:not([disabled])'
292+
'input[type="search"], input:not([disabled])'
293293
) as NodeListOf<HTMLElement>;
294294

295295
// Don't interfere with the event if there aren't any options that the user can interact with
@@ -505,6 +505,7 @@ const Dropdown = (props: DropdownProps) => {
505505
options={displayOptions}
506506
selected={sanitizedValues}
507507
onSelectionChange={updateSelection}
508+
inputType={multi ? 'checkbox' : 'radio'}
508509
className="dash-dropdown-options"
509510
optionClassName="dash-dropdown-option"
510511
optionStyle={{

0 commit comments

Comments
 (0)