elk-zone / elk

A nimble Mastodon web client
https://elk.zone
MIT License
5.22k stars 535 forks source link

Bug with cmd k, cmd / #2863

Open joelanman opened 1 month ago

joelanman commented 1 month ago

If I press cmd k or cmd /, then press esc, I get odd behaviour:

on Elk main Version canary (0b53dfc@main), Safari MacOS

stackblitz[bot] commented 1 month ago

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

lazzzis commented 1 month ago

reproducible on firefox as well. At least the "?" does not open the shortcut dialog after pressing "cmd k".

Not reproducible on chrome.

The cause is the notUsingInput is still returns false. And the activeElement is different with document.activeElement.

https://github.com/elk-zone/elk/blob/0b53dfc89ffcbfee58277b338e3850954ca71bf9/plugins/magic-keys.client.ts#L13

I thought this should have been fixed by updating vueuse/core #2674, but somehow still broken on Elk. Not sure this is a bug of Elk or vueuse.

https://github.com/elk-zone/elk/assets/10359255/e029d2cd-b541-430b-ab24-9e2a74ad6a74

lazzzis commented 1 month ago

It appears this is because of a behavior difference between Firefox and Chrome. I filed a bug in vueuse https://github.com/vueuse/vueuse/issues/3954