-
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
LineHeightControl: Make spin buttons adjust from placeholder value #49150
LineHeightControl: Make spin buttons adjust from placeholder value #49150
Conversation
Size Change: +38 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
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.
Nice simple fix, this is testing well for me 👍
✅ + button moves up from 1.5
placeholder state
✅ - button moves down from 1.5
placeholder state
✅ works nicely in post editor and global styles
Not at all a blocker, but one thing I did notice is that if I go to click the minus button for a block where the existing (real) line height is less that 1.5, then the line-height in the editor canvas appears to jump "up" to the new value of 1.4, which might be a tiny bit unexpected if someone was trying to click -
to make the line-height smaller. On balance, though, that's much less unexpected than the 0
based value prior to this PR. Quick demo of that behaviour:
LGTM! ✨
Appreciate the detailed and thoughtful reviews as always @andrewserong 🙇
Good point. I agree it is a smaller UX issue than it jumping to I get the suspicion ironing out this kink might fall a little into the domain of themes. With the recent access given in the block editor to the merged global styles data, we could potentially use that to set a placeholder value in the line height control closer to what's "real". There'd still be the potential for a theme-loaded stylesheet to apply a line-height independent of theme.json and global styles which would leave us back where we started. Detecting the computed line-height for the block also seem rather inaccurate and heavy-handed 🤔 As you suggested, that all might be better suited to a follow-up and shouldn't block this PR. I'll get this one merged 🚢 |
Fixes: #48766
What?
Updates the
LineHeightControl
to make adjustments via the custom spin buttons from the placeholder value rather than zero.Why?
1.5
is displayed in the input, it is unexpected that the spin buttons adjust the value from zero.How?
Testing Instructions
1.6
instead of0.1
.1.4
instead of0
.Screenshots or screencast
Screen.Recording.2023-03-17.at.11.46.39.am.mp4