Skip to content

Shift+Enter to findPrev, when edit-find dialog field is focused #1945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dnknn opened this issue Mar 17, 2025 · 1 comment
Closed

Shift+Enter to findPrev, when edit-find dialog field is focused #1945

dnknn opened this issue Mar 17, 2025 · 1 comment

Comments

@dnknn
Copy link

dnknn commented Mar 17, 2025

version: Stylus-mv2-2.3.14-e385558-id.zip, the edit-find dialog of the editor page

  • suggestions : When focus on the edit-find field, ability to use Shift+Enter to findPrev. Image
    1. Ctrl+F
    2. F3Enterfind-field is focused : findNext.
    3. Shift+F3Shift+Enterfind-field is focused : findPrev. (the browser's page search or DevTools search field or CodeMirror6Demo is exactly the same)
    4. Supporting Shift+Enter to findPrev will be more convenient, and it will also be consistent with the browser's own search experience
questions

Image

I don't know from which version, after these buttons (elements) are focused, using the Enter key is invalid.

This was sometimes done before. 1. Ctrl+F 2. Press Tab to navigate(focus) to the button, then press Enter.

@dnknn dnknn changed the title [Editor search] Added Shift+Enter to findPrev, when the search field is focused Shift+Enter to findPrev, when edit-find dialog field is focused Mar 18, 2025
@dnknn
Copy link
Author

dnknn commented Mar 30, 2025

I tried to modify it myself to support Shift-Enter, and it worked. Append the code after here,

    'Shift-Enter': () => {
      switch (document.activeElement) {
        case stateInput:
        case stateInput2:
          if (stateDialog.dataset.type === 'find') {
            doSearch({reverse: true});
          } else {
            doReplace();
          }
      }
    },

@dnknn dnknn closed this as completed May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant