Conversation
|
|
||
| // 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.
Consider adding a type guard or checking if option is of type InputSelectOption before casting. This will ensure type safety and prevent potential runtime errors if option is not of the expected type.
| form: findParentFrom(wrapRef.current as HTMLDivElement), | ||
| name: props.name, | ||
| value: (option as InputSelectOption).value, | ||
| value: selectedOption?.value || '', |
There was a problem hiding this comment.
The use of optional chaining (?.) is a good approach to handle potential null or undefined values. However, ensure that selectedOption is always of type InputSelectOption | null to avoid unexpected behavior.
src/libs/ui/lib/components/form/form-groups/form-input/input-select-react/InputSelectReact.tsx
Show resolved
Hide resolved
kkartunov
approved these changes
Jul 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 for Hi, user!