Skip to content
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

Keyboard shortcut for strikethrough overwrites browser shortcut for switching to right to left language layout #2540

Closed
1 of 2 tasks
max-nextcloud opened this issue Feb 17, 2022 · 12 comments · Fixed by #4288
Assignees
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@max-nextcloud
Copy link

What’s the bug you are facing?

When using a tiptap editor with strikethrough nodes pressing ctrl+shift+x results in switching to strikethrough. However this shortcut is the default for switching to a right to left language layout and back in firefox. Using it in the github editor for example changes the text input layout to provide for better input experience for hebrew and arabic and other rtl languages.

How can we reproduce the bug on our side?

Press ctrl+shift+x in the editor on tiptap.dev
Open a comment here with firefox and press ctrl+shift+x to see the expected behavior.

Can you provide a CodeSandbox?

tiptap.dev ;)

What did you expect to happen?

Open a comment here with firefox and press ctrl+shift+x to see the expected behavior.

Anything to add? (optional)

I'm not sure how relevant this is. Chrome only seems to offer the switch in a browser extension. If the language settings of the browser are a rtl language this will probably also be the default for the text entry. So it's only necessary if you want to write non-rtl text in an rtl language browser or the other way round. However this can be a frequent in a multi language environment.

I'm also not aware of any workarounds to switch the text entry direction without the keyboard shortcut - but i am also not writing rtl languages.

Just wanted to flag this as a possible issue. Feel free to close if picking a different default for the keyboard shortcut is problematic.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@max-nextcloud max-nextcloud added the Type: Bug The issue or pullrequest is related to a bug label Feb 17, 2022
@max-nextcloud
Copy link
Author

https://defkey.com/search?irq=strikethrough has a list of keyboard shortcuts in other apps for strikethrough... seems to be very inconsistent. Having an 'S' in there would match the icon that's used on tiptap.dev and other instances i saw.

@max-nextcloud
Copy link
Author

I'm happy to provide a PR if I know what to change it to. Ctrl+shift+s was my first choice. It's also the most common in the list i just posted.

In firefox it defaults to creating a screenshot. However one could work around this by focusing a different dom element than the editor and pressing ctrl+shift+s to create a screenshot.

@cadars
Copy link
Contributor

cadars commented Feb 17, 2022

What about ctrl+alt+x? The problem with s for “Strikethrough” is that it’s English specific, while x could be a more internationally recognized symbol for suppression?

@pat-githubber
Copy link

If a keyboard shortcut is needed for strikethrough, I would like to share some thoughts but I have to highlight that I rarely use strikethrough and having no shortcut is also fine (for now, I guess 😄):

  1. ctrl+alt+x is available and does not open the menu bar neither in firefox nor chrome as well as the x makes logically sense with respect to strikethrough (cross out something). Therefore, it would be my favorite.
  2. Due to (1.), ctrl+shift+x would not be needed especially since it is already used for right to left languages (Hebrew, Arabic, ...) in firefox
  3. All shortcuts with the key s should be avoided due to the frequent use as described above. Regarding your post @max-nextcloud, ctrl+alt+s opens the menu bar in firefox, hence would be unsuitable.
  4. Last though, what about alt+MinusKey? It is availble on firefox/chrome and it would make also sense.

@cadars
Copy link
Contributor

cadars commented Feb 26, 2022

About 4: plus and minus should be reserved to zoom-in/out I think, with or without modifier keys.

@max-nextcloud
Copy link
Author

max-nextcloud commented Feb 26, 2022

The problem with s for “Strikethrough” isThe problem with s for “Strikethrough” is that it’s English specific, while x could be a more internationally recognized symbol for suppression?

Well B for bold and I for italic are also language specific and given that these letters are also most frequently used for the corresponding buttons my intuition would still be to try S to toggle the third button here (screenshot taken on tiptap.dev) :

Bildschirmfoto von 2022-02-26 15-12-13

@stale
Copy link

stale bot commented Jul 6, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added stale and removed stale labels Jul 6, 2022
@mejo-
Copy link
Contributor

mejo- commented Sep 7, 2022

This issue still persists.

@pat-githubber
Copy link

On latest MacOS (v12.5.1) and latest Firefox (104.0.1 (64-bit)), the shortcut cmd+shift+x works perfectly fine, now.

I suppose ctrl+shift+x works, as well? Could someone confirm, please 🙏

@max-nextcloud
Copy link
Author

Hi @pat-githubber

On latest MacOS (v12.5.1) and latest Firefox (104.0.1 (64-bit)), the shortcut cmd+shift+x works perfectly fine, now.

What do you mean by perfectly fine?

  • Does it change the text to be striked through
  • or does it toggle right to left typing as it does in browsers by default.

The issue i tried to point out is that the keyboard shortcut is conflicting with a browser default shortcut that may be important for people writing text in hebrew, arabic or other right to left languages.

@pat-githubber
Copy link

I understand the issue/conflict with right to left languages. I made a recording.

Ok, now I am confused. Somehow the first attempt did not work but then it worked. Check the video.

Screen.Recording.2022-09-07.at.12.13.17.mov

@bdbch bdbch added this to the 2.0.0 milestone Sep 14, 2022
@bdbch bdbch self-assigned this Sep 14, 2022
@bdbch bdbch removed this from the 2.0.0 milestone Feb 23, 2023
@github-actions
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Jun 18, 2023
@bdbch bdbch removed the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants