Skip to content

Commit a79be2e

Browse files
committed
use key to nuke combobox on host filter value type change
1 parent 45b8585 commit a79be2e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/forms/firewall-rules-common.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ const DynamicTypeAndValueFields = ({
125125
{/* In the firewall rules form, a few types get comboboxes instead of text fields */}
126126
{valueType === 'vpc' || valueType === 'subnet' || valueType === 'instance' ? (
127127
<ComboboxField
128+
// key means we nuke the entire field when we change types. this fixes
129+
// a bug where the firewall rule host filter combobox would keep an
130+
// custom value query around when you change types
131+
key={valueType}
128132
disabled={disabled}
129133
name="value"
130134
{...getFilterValueProps(valueType)}
@@ -468,7 +472,7 @@ export const CommonFields = ({ control, nameTaken, error }: CommonFieldsProps) =
468472
/>
469473

470474
<div className="flex flex-col gap-3">
471-
{/* We have to blow this up instead of using TextField to get better
475+
{/* We have to blow this up instead of using TextField to get better
472476
text styling on the label */}
473477
<div className="mt-2">
474478
<label id="portRange-label" htmlFor="portRange" className="text-sans-lg">

0 commit comments

Comments
 (0)