Open lorenzolewis opened 1 year ago
I can't reproduce this 100% of the time, sometimes the shortcut works, sometimes it doesn't and Safari steals the show.
I'm using event.preventDefault()
though :(
https://github.com/histoire-dev/histoire/blob/a326a6a9522fd8437f0abfb6280590b0d404a05e/packages/histoire-app/src/app/components/app/AppHeader.vue#L19
So I've just tried on my Macbook on Safari 16.0 and I can't reproduce. Did you make sure to press [Shift] too?
I can't get it to reproduce 100% of the time, but it seems like it happens when the page loads and the browser is out of focus, then when I focus again it's like the preventDefault didn't take affect. I think in general sites try to avoid any shortcuts using meta keys and treat them as reserved by the browser. In the code there's a shortcut also defined that doesn't use the meta key https://github.com/histoire-dev/histoire/blob/c85126efea5744cc9bb830b5059e2d436cc991b1/packages/histoire-app/src/app/components/app/AppHeader.vue#L18
So maybe just adapting the tooltip on the button to show the ctrl+shift+d
shortcut instead of meta+shift+d
(for webkit browsers at least) could avoid hitting up against the edge case?
I'm not sure ^+Shift works on Mac
I played around a little with this scenario is found:
meta + shift + d
this is the shortcut for Adding the current page to the Reading List, or in Firefox - Add to Bookmarkfunction onIframeLoad
i think it should be added useEventListener
Describe the bug
The shortcut for dark mode toggle of meta + shift + d has a conflict in Safari on macOS (which maps to Bookmarks > Add to reading list). This makes the keybinding unusable since the browser doesn't pass it on.
This is using version 0.11.6 of histoire.
I'd recommend using a keybinding that isn't using any modifier keys (such as just
d
) since browsers all like to have their own different combinations of keyboard shortcuts.Reproduction
N/A, just need to use any project on a Mac with Safari.
System Info
Used Package Manager
pnpm
Validations