[PR #5811] [MERGED] fix(common): prevent support menu from triggering in editors #5363

Closed
opened 2026-03-17 02:49:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5811
Author: @Leon-Luu
Created: 1/29/2026
Status: Merged
Merged: 2/3/2026
Merged by: @jamesgeorge007

Base: patchHead: fix/shift_to_block_support_menu_codemirror


📝 Commits (3)

  • 832c828 fix: shift not trigger on codemirrors
  • 1b1b0e8 Merge branch 'main' into fix/shift_to_block_support_menu_codemirror
  • c042452 Merge branch 'main' into fix/shift_to_block_support_menu_codemirror

📊 Changes

1 file changed (+16 additions, -0 deletions)

View changed files

📝 packages/hoppscotch-common/src/helpers/keybindings.ts (+16 -0)

📄 Description

What the fix does:

Prevents the Support menu (triggered by Shift+/) from opening when typing "/" in CodeMirror or Monaco editors. The fix adds a defensive check at the action execution level to ensure that when you're typing in an editor, the keystroke is treated as text input rather than a keyboard shortcut.

Why both fixes are needed:

Old fix (65046526f, line 280): Attempts to prevent the binding string generation early in the event flow. When it works, it's more efficient - avoids unnecessary lookups and checks.

New fix : Catches cases where the old fix fails due to event capture phase timing issues. With capture: true (973572d06 ), events are intercepted very early, sometimes before CodeMirror's focus handlers complete. This causes the early check to miss some cases.

Together they provide "defense in depth" where The old fix handles most cases efficiently, while the new fix acts as a safety net for edge cases caused by the capture phase event handling. Both are needed because the capture phase can cause timing-dependent detection failures that neither fix alone can handle reliably.

Closes #
https://github.com/hoppscotch/hoppscotch/issues/5777

What's changed

Notes to reviewers


Summary by cubic

Prevents the Support menu (Shift+/) from opening when typing "/" in CodeMirror, Monaco, or input fields. Typing now behaves normally without accidental shortcut triggers.

  • Bug Fixes
    • Added a binding-level check for "shift-/" in the keydown handler.
    • Skip the shortcut when the focused element is a CodeMirror editor, Monaco editor, or any typable element.

Written for commit c042452677. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5811 **Author:** [@Leon-Luu](https://github.com/Leon-Luu) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 2/3/2026 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `fix/shift_to_block_support_menu_codemirror` --- ### 📝 Commits (3) - [`832c828`](https://github.com/hoppscotch/hoppscotch/commit/832c828220c8be69c739fc541fd53014dbc35329) fix: shift not trigger on codemirrors - [`1b1b0e8`](https://github.com/hoppscotch/hoppscotch/commit/1b1b0e82a261dae57fcfe5026b408792ed702ca5) Merge branch 'main' into fix/shift_to_block_support_menu_codemirror - [`c042452`](https://github.com/hoppscotch/hoppscotch/commit/c042452677cebccbaf98d04a024c48ddfeed6965) Merge branch 'main' into fix/shift_to_block_support_menu_codemirror ### 📊 Changes **1 file changed** (+16 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/helpers/keybindings.ts` (+16 -0) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> **What the fix does:** Prevents the Support menu (triggered by Shift+/) from opening when typing "/" in CodeMirror or Monaco editors. The fix adds a defensive check at the action execution level to ensure that when you're typing in an editor, the keystroke is treated as text input rather than a keyboard shortcut. Why both fixes are needed: **Old fix** (65046526f, line 280): Attempts to prevent the binding string generation early in the event flow. When it works, it's more efficient - avoids unnecessary lookups and checks. **New fix** : Catches cases where the old fix fails due to event capture phase timing issues. With capture: true (973572d06 ), events are intercepted very early, sometimes before CodeMirror's focus handlers complete. This causes the early check to miss some cases. Together they provide "defense in depth" where The old fix handles most cases efficiently, while the new fix acts as a safety net for edge cases caused by the capture phase event handling. Both are needed because the capture phase can cause timing-dependent detection failures that neither fix alone can handle reliably. <!-- If this pull request closes an issue, please mention the issue number below --> Closes # <!-- Issue # here --> https://github.com/hoppscotch/hoppscotch/issues/5777 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed <!-- Describe point by point the different things you have changed in this PR --> <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevents the Support menu (Shift+/) from opening when typing "/" in CodeMirror, Monaco, or input fields. Typing now behaves normally without accidental shortcut triggers. - **Bug Fixes** - Added a binding-level check for "shift-/" in the keydown handler. - Skip the shortcut when the focused element is a CodeMirror editor, Monaco editor, or any typable element. <sup>Written for commit c042452677cebccbaf98d04a024c48ddfeed6965. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:49:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5363
No description provided.