Skip to content

Hotkeys Stop Working After Switching Between Preview and Edit Modes #1298

Description

Bug Report: Hotkeys Stop Working After Switching Between Preview and Edit Modes

🐛 Bug Description

When using the Markdoc editor, keyboard shortcuts (hotkeys) stop functioning after switching from editing mode to preview mode and back to editing mode.

🔍 Steps to Reproduce

  1. Navigate to the editor page (/create or /create/{id})
  2. Start typing in the editor textarea
  3. Test any hotkey (e.g., Ctrl+B for bold, Ctrl+I for italic, Ctrl+1 for heading 1)
    • ✅ Hotkeys work correctly
  4. Click the "View preview" button
  5. Click the "Back to editing" button
  6. Try using the same hotkeys again
    • ❌ Hotkeys no longer work

🎯 Expected Behavior

Hotkeys should continue to work normally after switching between preview and edit modes.

💻 Current Behavior

Hotkeys become unresponsive after returning from preview mode to editing mode.

Affected Hotkeys

All markdown formatting hotkeys are affected:

  • Ctrl+1 through Ctrl+6 - Headings
  • Ctrl+B - Bold
  • Ctrl+I - Italic
  • Ctrl+Shift+B - Bold Italic
  • Ctrl+S - Code snippet
  • Ctrl+Shift+C - Code block
  • Ctrl+Shift+. - Block quote
  • Ctrl+L - Link
  • Ctrl+Shift+I - Image
  • Ctrl+U - URL
  • Backspace - Select previous

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions