[EuiRange] Remove 20 tick hard limit, detect minimum tick width instead#6829
[EuiRange] Remove 20 tick hard limit, detect minimum tick width instead#6829cee-chen merged 4 commits intoelastic:mainfrom
Conversation
|
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
|
💚 CLA has been signed |
|
Heya @swapnil-talpade, thanks for taking on this PR! 💚 The code itself looks fine, but as a heads up, the CLA is complaining because you'll need to sign https://www.elastic.co/contributor-agreement with the email address specifically attached to the git commit (you can do a local Let me know when you've signed, and I'll push up a changelog and run CI tests after. |
|
Thanks |
- more accurate and (hopefully) helpful than just using a more arbitrary # of ticks - I was updating tests for the new behavior and couldn't help myself from going overboard
|
I went a little overboard when updating tests and figured I might as well make our tick render detection a tiny bit smarter while here 😄 The behavior now warns & errors based on track/tick width instead of a static tick count. I also marked this as a breaking change as it will potentially affect consumers who haven't been careful to test their components in smaller mobile screens. LMK if you have any questions about the changes! |
|
jenkins test this |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6829/ |
eui@81.3.0 ⏩ eui@82.1.0 ## [`82.1.0`](https://github.com/elastic/eui/tree/v82.1.0) - Added ability for `EuiMarkdownEditor` plugins to disable toolbar buttons ([#6840](elastic/eui#6840)) ## [`82.0.0`](https://github.com/elastic/eui/tree/v82.0.0) **Bug fixes** - Fixed `EuiPopover`'s types to omit `panelProps.hasBorder` and `panelProps.hasShadow` - these props are not customizable on popovers for visual consistency ([#6836](elastic/eui#6836)) **Breaking changes** - `EuiRange` & `EuiDualRange` no longer have a hard limit of 20 displayed ticks. The component now instead detects the width available, and throws an error if each tick has less than 5 pixels of width. We recommend testing your tick usage at smaller screens to ensure they always display legibly to users. ([#6829](elastic/eui#6829))
Summary
closes #6807
This PR removes the hard-coded limit (thrown error) of 20 ticks visible, and instead uses the width of the track (on mount) to detect if each tick has a minimum width.
QA
General checklist