-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix RangeControl mark placement and cursor styles #26745
Fix RangeControl mark placement and cursor styles #26745
Conversation
8d8b31a
to
b17b287
Compare
@ItsJonQ, it'd be great if you can have a look (at your leisure, I don't think there's any urgency). Currently, in Gutenberg, there are no instances of the use cases fixed by this PR. So for testing Storybook is easiest (but also lacks coverage of such use cases). This gist contains the story I used in testing. If it's deemed worthwhile I'm willing to add stories to this PR, but I'd like to know if there are some guidelines to follow for those additions. |
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.
@stokesman 🚀 from me! Thank you so much for the update! You're totally right. The previous implementation didn't correctly handle negative min
values. The pointer-events
fix is also very welcomed.
The gist you shared was very helpful! Do you think you'd be able to add that to the existing story? :)
I think it would be helpful for future testing and development.
Thanks! ✨
730a8c3
to
1564533
Compare
RangeControl has the little-used feature of marks. Using the prop
marks
they can be placed automatically or specified ("custom" in the screenshots). The placement of specified marks will be incorrect if thestep
property is decimal or themin
property is negative.An example with
step
property as decimal:An example with
min={ -10 }
andmax={ 10 }
:In such cases not only are the custom marks out of place, (when
value
is undefined) the calculation for which marks are represented as "filled" is incorrect.Additional changes not related to the aforementioned mark issues are minor styling changes to fix: #25345. Though it turns out those styling changes helped reveal a further issue with the marks. They obscure interaction with the input:
Not something that would occur often but glad to have caught it. Commit 8d8b31a1d9f0565dc674fd6ced219e7f94374aaf pushed to resolve that.
How has this been tested?
In Storybook using this story:
https://gist.github.com/stokesman/155ec2791493a3e9fe134ac6ee988235
In WordPress 5.5.1 with a custom block using a RangeControl with custom marks
Types of changes
Bug fix
Checklist: