-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 color remove button in Safari #62698
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +23 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
FYI @afercia if you have more context. |
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.
Worked very well on my tests, thank you for looking into this issue @ellatrix 👍
I have no idea why this specific icon button seems to behave differently from other buttons in Safari. Are we sure it's the SVG? I can only report that |
It's because, while this button is open, there's also a popover that uses the |
@ellatrix I replaced the |
Does it work consistently? @jorgefilipecosta Mentioned it can be inconsistent. |
I re-tested it and no, unfortunately it doesn't. To me, it's a matter of timing rather than focus or the SVG. It appears some browsers fire the click event before the button gets removed, while in Safari the button is removed first. I'd argue the root problem is in the design of this UI in the first place. |
d33a8b7
to
2f6407d
Compare
@afercia Completely agree, after testing, it looks like this whole things is completely inaccessible. Once I open the popover, I can't even close it. It looks like this will need a larger refactor to get to work properly, and it feels too late just a few days before RC. Additionally, I wasn't aware that this problem (both the Safari issue and accessibility issue) has existed for a long time. |
I'm looking into a complete fix now |
What?
This is an alternative PR to #62628. The problem is that the SVG element is focusable in Safari, which triggers the focus-outside hook (which normally ignores button clicks), so the onClick handler for the button is never called.
Why?
Fixes #62261.
How?
The SVG is already made non focusable, but Safari seems to disobey that attribute.
However,While this worked for me, it didn't seem to work for @jorgefilipecosta. However,disabled
works.pointer-events: 'none'
works for both of us. Maybe we should keepdisabled
, not sure.Testing Instructions
Use Safari.
Go to Global Styles→ Colors → Palette.
Add a custom color and press Done.
Click the three dots and then "Show details".
Click the button to remove that custom color and see if it works as expected.
Testing Instructions for Keyboard
Screenshots or screencast