-
Notifications
You must be signed in to change notification settings - Fork 34
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
show check in both cases #2098
Conversation
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.
{(internalSelectedValues?.includes(option.value) || | ||
internalSelectedValues === option.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.
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
:
{(internalSelectedValues?.includes(option.value) || | |
internalSelectedValues === option.value) && ( | |
{(isMultiSelect ? internalSelectedValues.includes(option.value) : | |
internalSelectedValues === option.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.
@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, |
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.
👍 You said this is a Prettier autofix.
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.
It's fine, but I gave a potential comment to fix it with a ternary. Up to you.
227bf17
to
f80332a
Compare
@@ -191,7 +191,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>( | |||
"aria-errormessage": errorMessageElementId, | |||
"aria-labelledby": labelElementId, | |||
"data-se": testId, | |||
inputmode: inputMode, |
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.
👍
{!hasMultipleChoices && | ||
(internalSelectedValues?.includes(option.value) || | ||
internalSelectedValues === option.value) && ( | ||
<ListItemSecondaryAction> | ||
<CheckIcon /> | ||
</ListItemSecondaryAction> | ||
)} |
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.
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] | |||
); | |||
|
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.
Can we re-add this newline?
f80332a
to
4999a06
Compare
OKTA-688591
Summary
Testing & Screenshots