-
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
Style Variation picker: restore pointer cursor when withHover is in use #49596
Style Variation picker: restore pointer cursor when withHover is in use #49596
Conversation
Size Change: +15 B (0%) Total Size: 1.35 MB
ℹ️ View Unchanged
|
Flaky tests detected in eae071a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4614234223
|
Can
|
Unfortunately, that doesn't appear to work for this case. This component is a little tricky: Usually, we'd set Conversely, if we use the So, I think all that means that we need to fix this within the iframe.
I agree. Since it appears that we need to do set the |
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.
Unfortunately, that doesn't appear to work for this case.
That's a shame.
I agree. Since it appears that we need to do set the cursor within the iframe, what do you think about adding an isButton prop so that we have clearer semantics?
That does sound like it'll make the component become a button.
Let's go with what you have here for now if there's no easy option.
Thank you for spotting the regression and fixing it.
Yes, I was hoping for a quick CSS fix, too! 😅
Thanks for reviewing and for the back-and-forth, happy to look into a follow-up if it winds up looking like we want a more explicit fix. |
What?
In #49573 the
cursor: pointer
rule was removed from the style variation preview, so that it doesn't appear to be clickable from the styles panel. However it looks like that removal might have unintentionally removed the rule from the button previews for the style variations in theBrowse styles
screen.This PR restores the
cursor: pointer
rule when thewithHover
option is in use for the preview — the assumption being that if we're using the hover state, we're also using the preview as a button.Why?
Ensure that the button version of the style variation previews are clickable. The rule needs to be set within the iframe for it to work.
How?
withHover
is in use.Question: is it okay to tie this rule to
withHover
, or should we be more explicit with an additionalisButton
prop or something like that? I tried fixing this by settingcursor: pointer
further up the chain, but it looks like it needs to be set within the iframe.Testing Instructions
Screenshots or screencast