codu-code / codu

Codú's open-source codebase. A space for coders. Visit our community!
https://codu.co/
Apache License 2.0
120 stars 91 forks source link

Bug: On New post page, hotkeys register even when text input are not focused on #703

Open thanhsonng opened 7 months ago

thanhsonng commented 7 months ago

Context

On New post page (/create), try pressing ctrl/cmd + 1 (or 2, 3, 4, etc).

Expected Behavior

If Post body input (markdown-supported text area) is not in focus, browser should switch to the respective tab number 1, 2, 3, 4, etc. (default browser behavior).

If Post body input is in focus, then the respective hotkeys can register (e.g. ctrl/cmd + 1 creates a level 1 heading in markdown (#). For the full list, see /markdoc/editor/hotkeys/hotkeys.markdoc.ts.

Current Behavior

Hotkeys always register, regardless of the focus state of the Post body text input.

Screenshots

Image of said bug

Steps to reproduce

See above.

Additional info

N/A

NiallJoeMaher commented 7 months ago

What a strange one. I really need to finish the new editor so we can kill this one anyway 😂