-
Notifications
You must be signed in to change notification settings - Fork 841
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
EuiColorPicker uses standard portal DOM positioning, intentional popover entrance #2038
Conversation
top: 0, | ||
}); | ||
const [lastColor, setlastColor] = useState<HSV | {}>({}); | ||
export const EuiSaturation: FunctionComponent<EuiSaturationProps> = forwardRef( |
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 diff is unfortunate. The gist is that I added forwardRef
and a single ref, which changes a bunch of indentation. Nothing important to review in the file.
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.
Code changes LGTM; Tested mouse & keyboard interaction locally, including with the added container example.
The popover is not closable by keyboard when focus is still on the color picker, tabbing off of the color picker's elements allows Escape
to close the popover. I'm not sure if this should be a blocker or not.
|
I honestly don't think this component needs the dropdown arrow. It just adds noise and extra tab to get out of the input. I do think it needs better VO instruction when you tab into it since all you get is: For me, when the picker is in a popover, and I escape to close the picker, it doesn't focus back on the input like the normal one does. But I think that's the only flaw I saw. |
Yep. On it.
The popover thing was a mistake a made in the docs. Fixed now. I did notice that the modal steals focus no matter what, though (you can see it happen with the select in the first example here: https://elastic.github.io/eui/#/layout/modal). I'm going to open an issue for it.
I could see this (as @snide mentioned at one point) being more like |
I'll dissent, but not strongly. I navigate form fields primarily with the keyboard, and I don't think I would discover that the color picker opens without some visual indication. Maybe I would try the up & down arrows to see if it some how modifies the field value, and find instead that My 2¢, take it or leave it :) |
Also think the arrow, even if it's just an indication and not a button (which I still think is fine to make just visual), is helpful to be there. Even in @cchaos' mock above... yes, it does add visual noise, but even with that gradient there it lets me know the gradient itself is clickable and will probably do something (even if I don't know what that something is). I think it's useful the same way the carets are useful on old fashioned primary, filled buttons. It just telegraphs what happens next. |
Yay @chandlerprall found a popover bug. If you have an I'll open a bug for this Bug: #2042 |
Latest commit makes the arrow a visual indicator only. See how that feels. |
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 looks like I'm outnumbered 😜 I'm happy that it's not a button at least and maybe we can revisit just the "compressed" version when those get implemented.
Summary
Uses the idea behind #1988 to address positioning inconsistency when
EuiColorPicker
is placed in a popover. Often, the problem can be "fixed" withposition: fixed
, but wecanshould do better.The immediate change here is that the nested
EuiPortal
is no longer injected within the color picker component tree. Instead, it uses its shallow, late placement in the DOM to always ensure positioning (like otherEuiPopover
things).The second change would resolve #1988, if accepted. It takes the concept from #1914 (comment), which asserts that popover-aided form elements should generally behave like native
select
elements:The fundamental changes:
EuiComboBox
, et al.).z-index
and positioning management math by fully embracing the EUI Platform™.Checklist
- [ ] This was checked in mobile- [ ] Any props added have proper autodocs- [ ] This required updates to Framer X components