-
Notifications
You must be signed in to change notification settings - Fork 839
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
EuiRange and EuiDualRange fixes #1580
Conversation
Things to know for:
The thumbs/handles are not actually clickable. They are non-interactive indicators of the range values. Clicks and drags simply return a number in the range (exactly how the single range slider works) and we map it to the most relevant thumb/handle. When empty values were not valid, this was easier because we at least had points of reference. Now we have to try to infer which of the two values (min, max) the click is attempting to change. Chances are good we won't always be correct in this. We can get better, but right now this is the approach (set both values in the area of the click): eui/src/components/form/range/dual_range.js Lines 48 to 49 in ebaa1c4
|
Rather than attempt to interpret
Users would then have a more reasonable experience with knowing disabled vs enabled, and what the intended interaction is |
@thompsongl Can you check out the latest commit? Basically I released the eui/src/components/form/range/dual_range.js Lines 63 to 76 in ebaa1c4
I played around with it a bunch and I no longer get the issue I used to and it still seem to be working fine. But maybe they were trying to fix something I haven't run into. I'll give the |
Latest commit fixes tooltip shrinkage |
The one thing I see was re-introduced was a fix put in for the last comment here. Basically, during an "swap" there's a gap in values. If max is 50 and I overtake it with the min handle, min remains at 49, not 50. The gif in the original comment shows it best. (This is small potatoes, in my opinion, if we get better overall usability elsewhere)
I think this is great. We have to make inferences somewhere, and this is the simplest place. |
Ahh, I see. So playing with that more closely, it weirdly works correctly while dragging left (down) but skips 1 step when going right (up). But I'll agree that it's such a small potato that the overall bug-less experience is worth that extra 1 step weirdness. Which I honestly don't think will be noticeable or common. |
@cchaos Correct about the left vs. right movement, hence the extra logic and tracking for which direction the handles were moving. |
- Give the inputs a min-width in case of single digits. And remove shifting of inputs because they then don’t line up with other form rows - Custom tick values now properly account for minimum value - Fix styling of track color when not showing the range - Top level `className` should be applied to the top level wrapper - Better error handling of invalid steps/ticks
- Also fixed prepend/append of value
Not worrying about what handle was clicked…
bde2431
to
a1876a1
Compare
Keyboard behavior (arrows) doesn't work correctly with empty values. |
Thanks @thompsongl !! Outside of that issue, this is no longer a WIP and ready for official review. 🙌 |
cc @nreese |
Keyboard support for |
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.
Did a scan of functionality and a code scan of the Sass and docs. My comments are all on the docs side. Did not look too deep at the JS.
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.
Lots of good stuff, changes LGTM!
Bug fixing
className
now applied to the top level wrapperAdded validations
The EuiRangeTrack and EuiRangeLevels now handle some errors of invalid steps/ticks.
Split up the docs page into more sections
Todo:
@thompsongl I could use your help on the following
['', '']
Checklist
[ ] This was checked against keyboard-only and screenreader scenariosCrossing this one off because it's a bit out of scope for this PR. There is basic keyboard-only interactions though they could probably be enhanced.[ ] This required updates to Framer X components