- Notifications
You must be signed in to change notification settings - Fork16
PM-1315 Fix issues on Copilot request form#1141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:dev
Are you sure you want to change the base?
Conversation
@@ -105,11 +106,12 @@ const InputSelectReact: FC<InputSelectReactProps> = props => { | |||
// throw the proper event type to the form handler (needs name & form element on target) | |||
function handleSelect(option: unknown): void { | |||
const selectedOption = option as InputSelectOption | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Consider adding a type guard or checking ifoption
is of typeInputSelectOption
before casting. This will ensure type safety and prevent potential runtime errors ifoption
is not of the expected type.
props.onChange({ | ||
target: { | ||
form: findParentFrom(wrapRef.current as HTMLDivElement), | ||
name: props.name, | ||
value:(option as InputSelectOption).value, | ||
value:selectedOption?.value || '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The use of optional chaining (?.
) is a good approach to handle potentialnull
orundefined
values. However, ensure thatselectedOption
is always of typeInputSelectOption | null
to avoid unexpected behavior.
src/libs/ui/lib/components/form/form-groups/form-input/input-select-react/InputSelectReact.tsxShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-1315
What's in this PR?
Fixes border color on hover for Skills input
Allows backspace to clear the project input
Fixes space in text forHi, user!