[PR #5224] [MERGED] fix: avoid shortcut conflicts in CodeMirror editors #5115

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5224
Author: @SharadSaha
Created: 7/6/2025
Status: Merged
Merged: 7/10/2025
Merged by: @jamesgeorge007

Base: patchHead: block-alt-up-down-in-editor


📝 Commits (3)

  • bd27a27 Restricted alt+up and alt+down default key bindings' behaviour inside editors
  • 80f4db7 changed helper function name and added JSDoc for isCodeMirrorEditor
  • 4a8177c added unit tests for dom.spec.js

📊 Changes

3 files changed (+97 additions, -1 deletions)

View changed files

📝 packages/hoppscotch-common/src/helpers/keybindings.ts (+10 -1)
packages/hoppscotch-common/src/helpers/utils/__tests__/dom.spec.js (+77 -0)
📝 packages/hoppscotch-common/src/helpers/utils/dom.ts (+10 -0)

📄 Description

Closes #4678

What's changed

Prevents alt+up and alt+down from changing the request method when focus is inside a typable element or the CodeMirror editor.

Why?

These shortcuts conflict with native CodeMirror actions like moving lines.

Notes to reviewers

Skips these keybindings in generateKeybindingString() when the event target is an .cm-editor input i.e CodeMirror editor.


🔄 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/5224 **Author:** [@SharadSaha](https://github.com/SharadSaha) **Created:** 7/6/2025 **Status:** ✅ Merged **Merged:** 7/10/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `block-alt-up-down-in-editor` --- ### 📝 Commits (3) - [`bd27a27`](https://github.com/hoppscotch/hoppscotch/commit/bd27a2717360d0d2cbbb5e379fe5b390fb29e117) Restricted alt+up and alt+down default key bindings' behaviour inside editors - [`80f4db7`](https://github.com/hoppscotch/hoppscotch/commit/80f4db70ece23e75fd6a732ccad2b9974b2324a5) changed helper function name and added JSDoc for isCodeMirrorEditor - [`4a8177c`](https://github.com/hoppscotch/hoppscotch/commit/4a8177c4c05a35451cc1581ed67133649f8006eb) added unit tests for dom.spec.js ### 📊 Changes **3 files changed** (+97 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/helpers/keybindings.ts` (+10 -1) ➕ `packages/hoppscotch-common/src/helpers/utils/__tests__/dom.spec.js` (+77 -0) 📝 `packages/hoppscotch-common/src/helpers/utils/dom.ts` (+10 -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. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #4678 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed Prevents `alt+up` and `alt+down` from changing the request method when focus is inside a typable element or the CodeMirror editor. ### Why? These shortcuts conflict with native CodeMirror actions like moving lines. <!-- 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 Skips these keybindings in `generateKeybindingString()` when the event target is an `.cm-editor` input i.e CodeMirror editor. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:35:27 +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#5115
No description provided.