FIX: Isolate modal and global key-binds (PR #12477)

This change makes is so that when a time-picking modal (e.g. “Add bookmark” modal) is visible, all global key bindings are paused.

  1. Fixes an issue where opening and closing a time-picking modal would break global single-key keybinds, so for example, L would no longer like posts, but L L would
  2. Fixes a related issue, where doing the above would also override custom keybinds provided by plugins (e.g. L shortcut that discourse-reactions uses)

Included:

  • DEV: Reset Mousetraps instead of unbinding
  • FIX: Make unbind use unbind
  • DEV: Don’t check for keyTrapper twice
  • DEV: Use an instance of Mousetrap
  • DEV: Remove an invalid for attribute (set_reminder doesn’t exist)
  • DEV: Add ability to pause all KeyboardShortcuts
  • FIX: Pause all keybinds when in a time-picking modal

GitHub

Looks quite nice!