fix: allow custom Azure OpenAI model names - #6643
Conversation
There was a problem hiding this comment.
Code Review
This pull request enables free-text input (freeSolo mode) for the Azure OpenAI model name selection and updates the AsyncDropdown and Dropdown components to support custom string values. However, in both dropdown components, the underlying TextField has its value prop explicitly bound to internalValue, which locks the input and prevents users from typing custom values freely. The feedback suggests removing this binding and using a placeholder to let the Autocomplete component manage its typing state internally.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| }} | ||
| options={options} | ||
| value={findMatchingOptions(options, internalValue) || getDefaultOptionValue()} | ||
| value={getAutocompleteValue(options, internalValue)} |
There was a problem hiding this comment.
While enabling freeSolo is intended to allow custom text input, the underlying TextField (line 235) has value={internalValue} explicitly set. Because internalValue is only updated on onChange (when a selection is committed), this binding locks the input field and prevents users from typing custom values freely.
To fix this, the value={internalValue} prop should be removed from the TextField inside renderInput, allowing Autocomplete to manage the input's temporary typing state internally. You can use placeholder to show the default helper text instead:
placeholder={internalValue === 'choose an option' ? 'choose an option' : ''}| loading={loading} | ||
| options={options || []} | ||
| value={findMatchingOptions(options, internalValue) || getDefaultOptionValue()} | ||
| value={getAutocompleteValue(options, internalValue)} |
There was a problem hiding this comment.
While enabling freeSolo is intended to allow custom text input, the underlying TextField (line 58) has value={internalValue} explicitly set. Because internalValue is only updated on onChange (when a selection is committed), this binding locks the input field and prevents users from typing custom values freely.
To fix this, the value={internalValue} prop should be removed from the TextField inside renderInput, allowing Autocomplete to manage the input's temporary typing state internally. You can use placeholder to show the default helper text instead:
placeholder={internalValue === 'choose an option' ? 'choose an option' : ''}
Summary
Validation
Closes #6590