Skip to content

Commit 3d21ebd

Browse files
author
Jeff Ng
authored
fix: Combobox's input to use inputProps readOnly instead of Combobox's readOnly (#1079)
1 parent 58155b6 commit 3d21ebd

File tree

3 files changed

+130
-84
lines changed

3 files changed

+130
-84
lines changed

packages/react-widgets/src/Combobox.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,10 @@ const ComboboxImpl: Combobox = React.forwardRef(function Combobox<TDataItem>(
404404
let completeType = filter ? ('list' as const) : ('none' as const)
405405

406406
let popupOpen = currentOpen && (!hideEmptyPopup || !!data.length)
407-
407+
let inputReadOnly =
408+
// @ts-ignore
409+
inputProps?.readOnly != null ? inputProps?.readOnly : readOnly;
410+
408411
return (
409412
<Widget
410413
{...elementProps}
@@ -432,7 +435,7 @@ const ComboboxImpl: Combobox = React.forwardRef(function Combobox<TDataItem>(
432435
autoFocus={autoFocus}
433436
tabIndex={tabIndex}
434437
disabled={isDisabled}
435-
readOnly={isReadOnly}
438+
readOnly={inputReadOnly}
436439
aria-busy={!!busy}
437440
aria-owns={listId}
438441
aria-autocomplete={completeType}

packages/react-widgets/src/DatePicker.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ const DatePicker = React.forwardRef(
520520

521521
let shouldRenderList = useFirstFocusedRender(focused, open!)
522522

523-
let inputReadOnly =
523+
const inputReadOnly =
524524
inputProps?.readOnly != null ? inputProps?.readOnly : readOnly
525525
return (
526526
<Widget

0 commit comments

Comments
 (0)