Skip to content
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

show check in both cases #2098

Merged
merged 3 commits into from
Feb 5, 2024
Merged

Conversation

bryancunningham-okta
Copy link
Contributor

@bryancunningham-okta bryancunningham-okta commented Jan 24, 2024

OKTA-688591

Summary

  • Fix inconsistency with showing the check on a selected item in the menu

Testing & Screenshots

  • I have confirmed this change with my designer and the Odyssey Design Team.

Copy link
Contributor

@chrispulsinelli-okta chrispulsinelli-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving an approval in case my 1 comment is not relevant. Also, beware of this complaint showing up in the review page:
image

Comment on lines 275 to 276
{(internalSelectedValues?.includes(option.value) ||
internalSelectedValues === option.value) && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this code, but I think it'd be better to make it clear which case would have an array and which wouldn't by using a ternary with isMultiSelect:

Suggested change
{(internalSelectedValues?.includes(option.value) ||
internalSelectedValues === option.value) && (
{(isMultiSelect ? internalSelectedValues.includes(option.value) :
internalSelectedValues === option.value) && (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinGhadyani-Okta Even in the non-multiselect version the value is sometimes an array. We need to check both cases I think

@@ -192,7 +192,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
inputProps={{
"aria-errormessage": errorMessageElementId,
"aria-labelledby": labelElementId,
"inputmode": inputMode,
inputmode: inputMode,
Copy link
Contributor

@KevinGhadyani-Okta KevinGhadyani-Okta Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 You said this is a Prettier autofix.

Copy link
Contributor

@KevinGhadyani-Okta KevinGhadyani-Okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, but I gave a potential comment to fix it with a ternary. Up to you.

@@ -191,7 +191,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
"aria-errormessage": errorMessageElementId,
"aria-labelledby": labelElementId,
"data-se": testId,
inputmode: inputMode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +275 to +297
{!hasMultipleChoices &&
(internalSelectedValues?.includes(option.value) ||
internalSelectedValues === option.value) && (
<ListItemSecondaryAction>
<CheckIcon />
</ListItemSecondaryAction>
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. Makes sense based on Figma.

I would like to check with Design to see if we want a checkbox on the left and a checkmark on the right because it's a bit jarring, the difference between the two side-by-side, but when you can only see one at a time, it's probably fine?

I still want to get their opinion now that we've seen this.

@@ -256,7 +256,6 @@ const Select = <
},
[normalizedOptions]
);

Copy link
Contributor

@KevinGhadyani-Okta KevinGhadyani-Okta Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we re-add this newline?

@bryancunningham-okta bryancunningham-okta merged commit 7c4c4d6 into main Feb 5, 2024
1 check passed
@bryancunningham-okta bryancunningham-okta deleted the bc/OKTA-688591/select-menu-check branch February 5, 2024 15:58
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.

3 participants