Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

web: fix <Menu /> in Safari 16 by preventing item blur event from bubbling#42779

Merged
courier-new merged 2 commits intomainfrom
kr/no-blur-bubble
Oct 11, 2022
Merged

web: fix <Menu /> in Safari 16 by preventing item blur event from bubbling#42779
courier-new merged 2 commits intomainfrom
kr/no-blur-bubble

Conversation

@courier-new
Copy link
Contributor

@courier-new courier-new commented Oct 10, 2022

As observed in Slack, menus that rely on the <Menu /> family of Wildcard components are broken in Safari 16 due to multiple blur events firing when the menu first opens and focus is transferred to the menu popover itself. The behavior has so far exclusively been observed in Safari 16.0 and 16.1. There is evidence that it may be fixed by 16.4, based on the currently available technology preview.

Tested both with keyboard navigation and mouse navigation in Safari 16, Chrome, and Firefox.

Safari Chrome
Screen.Recording.2022-10-10.at.2.32.39.PM.mov
Screen.Recording.2022-10-10.at.2.33.24.PM.mov

I have filed the follow-up ticket https://github.com/sourcegraph/sourcegraph/issues/42780 to revisit after Safari 16.4 is released.

Test plan

Fix was manually tested, see recordings above.

App preview:

Check out the client app preview documentation to learn more.

@courier-new courier-new added bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. safari wildcard-v2 wildcard-v2/menu labels Oct 10, 2022
@courier-new courier-new requested a review from a team October 10, 2022 21:45
@courier-new courier-new self-assigned this Oct 10, 2022
@cla-bot cla-bot bot added the cla-signed label Oct 10, 2022
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Oct 10, 2022

Codenotify: Notifying subscribers in OWNERS files for diff 66c77c4...db7b32a.

Notify File(s)
@sourcegraph/frontend-platform-devs client/wildcard/src/components/Menu/MenuItem.tsx
client/wildcard/src/components/Menu/MenuLink.tsx

Copy link
Contributor

@lrhacker lrhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected for me in Safari (and still in Chrome!). Thank you!! ❤️

@courier-new
Copy link
Contributor Author

Oops I should have put this on MenuLink, too, since it'll also bubble up if it's the first item in the list, like it is for the user nav menu. NOW the user nav menu will open again. 😂

Copy link
Contributor

@vovakulikov vovakulikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing this and for filing issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. cla-signed safari wildcard-v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants