Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

himaniraghav3
Copy link
Collaborator

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!

@@ -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

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 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.

props.onChange({
target: {
form: findParentFrom(wrapRef.current as HTMLDivElement),
name: props.name,
value: (option as InputSelectOption).value,
value: selectedOption?.value || '',

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 potential null or undefined values. However, ensure that selectedOption is always of type InputSelectOption | null to avoid unexpected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant