Skip to content

Commit 9c9dc14

Browse files
authored
Update isDisabled prop name for Comboboxes (#2465)
Update prop name for Comboboxes
1 parent 1aa0fc9 commit 9c9dc14

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

app/forms/firewall-rules-common.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const DynamicTypeAndValueFields = ({
9090
control,
9191
valueType,
9292
items,
93-
isDisabled,
93+
disabled,
9494
onInputChange,
9595
onTypeChange,
9696
onSubmitTextField,
@@ -99,7 +99,7 @@ const DynamicTypeAndValueFields = ({
9999
control: Control<TargetAndHostFormValues>
100100
valueType: TargetAndHostFilterType
101101
items: Array<{ value: string; label: string }>
102-
isDisabled?: boolean
102+
disabled?: boolean
103103
onInputChange?: (value: string) => void
104104
onTypeChange: () => void
105105
onSubmitTextField: (e: React.KeyboardEvent<HTMLInputElement>) => void
@@ -123,7 +123,7 @@ const DynamicTypeAndValueFields = ({
123123
{/* In the firewall rules form, a few types get comboboxes instead of text fields */}
124124
{valueType === 'vpc' || valueType === 'subnet' || valueType === 'instance' ? (
125125
<ComboboxField
126-
isDisabled={isDisabled}
126+
disabled={disabled}
127127
name="value"
128128
{...getFilterValueProps(valueType)}
129129
description="Select an option or enter a custom value"

app/ui/lib/Combobox.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { TextInputHint } from './TextInput'
2727
/** Simple non-generic props shared with ComboboxField */
2828
export type ComboboxBaseProps = {
2929
description?: React.ReactNode
30-
isDisabled?: boolean
30+
disabled?: boolean
3131
isLoading?: boolean
3232
items: Array<{ label: string; value: string }>
3333
label: string
@@ -64,7 +64,7 @@ export const Combobox = ({
6464
tooltipText,
6565
required,
6666
hasError,
67-
isDisabled,
67+
disabled,
6868
isLoading,
6969
onChange,
7070
onInputChange,
@@ -90,7 +90,7 @@ export const Combobox = ({
9090
onChange={(val) => onChange(val || '')}
9191
onClose={() => setQuery('')}
9292
defaultValue={selected}
93-
disabled={isDisabled || isLoading}
93+
disabled={disabled || isLoading}
9494
>
9595
{label && (
9696
// TODO: FieldLabel needs a real ID
@@ -113,10 +113,10 @@ export const Combobox = ({
113113
? 'focus-error border-error-secondary hover:border-error'
114114
: 'border-default hover:border-hover',
115115
hasError && 'data-[open]:ring-error-secondary',
116-
isDisabled
116+
disabled
117117
? 'cursor-not-allowed text-disabled bg-disabled !border-default'
118118
: 'bg-default',
119-
isDisabled && hasError && '!border-error-secondary'
119+
disabled && hasError && '!border-error-secondary'
120120
)}
121121
>
122122
<ComboboxInput
@@ -127,10 +127,10 @@ export const Combobox = ({
127127
onInputChange?.(event.target.value)
128128
}}
129129
placeholder={placeholder}
130-
disabled={isDisabled || isLoading}
130+
disabled={disabled || isLoading}
131131
className={cn(
132132
`w-full rounded !border-none px-3 py-[0.5rem] !outline-none text-sans-md text-default placeholder:text-quaternary`,
133-
isDisabled
133+
disabled
134134
? 'cursor-not-allowed text-disabled bg-disabled !border-default'
135135
: 'bg-default',
136136
hasError && 'focus-error'

0 commit comments

Comments
 (0)