diff --git a/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx b/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx index 029b9aed8db..d7ca062cde4 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx @@ -133,6 +133,8 @@ export const VPCPanel = (props: VPCPanelProps) => { ); }, [vpcs, region, fromLinodeCreate]); + const defaultVPCValue = fromLinodeConfig ? null : vpcDropdownOptions[0]; + const subnetDropdownOptions: DropdownOption[] = vpcs .find((vpc) => vpc.id === selectedVPCId) @@ -198,9 +200,6 @@ export const VPCPanel = (props: VPCPanelProps) => { {getMainCopyVPC()} { - return option.label === value.label; - }} onChange={(_, selectedVPC) => { handleSelectVPC(selectedVPC?.value || -1); // Track clearing and changing the value once per page view, configured by inputValue in AA backend. @@ -227,12 +226,11 @@ export const VPCPanel = (props: VPCPanelProps) => { selectedVPCId && selectedVPCId !== -1 ? vpcDropdownOptions.find( (option) => option.value === selectedVPCId - ) - : null + ) ?? null + : defaultVPCValue } autoHighlight clearIcon={null} - defaultValue={fromLinodeConfig ? null : vpcDropdownOptions[0]} // If we're in the Config dialog, there is no "None" option at index 0 disabled={!regionSupportsVPCs} errorText={vpcIdError ?? vpcError} label={from === 'linodeCreate' ? 'Assign VPC' : 'VPC'}