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

Alt+L in editor triggers numbered list #8687

Closed
PaszaVonPomiot opened this issue Jul 14, 2017 · 14 comments
Closed

Alt+L in editor triggers numbered list #8687

PaszaVonPomiot opened this issue Jul 14, 2017 · 14 comments
Assignees
Labels
bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with

Comments

@PaszaVonPomiot
Copy link

Issue Summary

Numbered list should be triggered by Ctrl+Alt+L but they are also triggered by Alt+L
I need to use Alt+L to type "Ł" letter.

Technical details:

  • Ghost Version: rc1
  • Node Version: 6
  • Browser/OS: Chrome
  • Database: MariaDB
@PaszaVonPomiot
Copy link
Author

Begging for fix in rc2 :D

@kevinansfield
Copy link
Contributor

@PaszaVonPomiot I'm not able to replicate this - for me Cmd-L toggles unordered list and Cmd-Alt-L toggles ordered list.

Alt-L outputs ¬
Alt-Shift-L outputs Ò

Are you on Windows per chance?

@PaszaVonPomiot
Copy link
Author

PaszaVonPomiot commented Jul 20, 2017

@kevinansfield yes, I'm a Windows 10 user.
Here's screencast. When I press right ALT the cursor changes to big "+" sign and then I press "L"
hover1

@kevinansfield
Copy link
Contributor

kevinansfield commented Jul 20, 2017

Hmm, I've just checked on windows 10 Chrome/Edge and can't reproduce, it's possible that's related to how my keyboard is mapped via my VM though. Ctrl-L and Ctrl-Alt-L worked fine for the list toggles 🤔

@PaszaVonPomiot
Copy link
Author

PaszaVonPomiot commented Jul 20, 2017

@kevinansfield the problem is that RAlt-L should not toggle list for selected paragraph.
I've checked on Firefox and Edge - the same issue. Then I've checked with different keyboard settings as normally I use "Polish (programmers)" keyboard layout

image

On English RAlt-L does not enable the list but on Polish it does.
and

According to tooltip numbered list should be only:
image

@ErisDS ErisDS added bug [triage] something behaving unexpectedly post 1.0.0 labels Jul 20, 2017
@ErisDS
Copy link
Member

ErisDS commented Jul 20, 2017

@PaszaVonPomiot I fully understand that for you this is an incredibly annoying bug, however it appears to be very specific to your language/environment.

We're now only fixing urgent bugs before the release of 1.0.0, if you'd like to submit a fix, we can review and merge it for the first post 1.0.0 bugfix release :) Otherwise we'll get to it as soon as we can.

@PaszaVonPomiot
Copy link
Author

The same issue is with Romainan keyboard ALT-L and ALT-P (this one publishes the post instead of inserting "§") character.

@kevinansfield kevinansfield added the help wanted [triage] Ideal issues for contributors to help with label Jul 22, 2017
@kevinansfield
Copy link
Contributor

The editor content shortcuts are handled in our fork of simplemde https://github.com/kevinansfield/simplemde-markdown-editor/blob/ghost/src/js/simplemde.js.

Definitely open to PRs with fixes or research/links to show how it's possible to deal with different keyboard layouts in JS key event handlers.

@PaszaVonPomiot
Copy link
Author

I won't be able to help with js as I'm not a programmer but hopefuly this will be useful. It appears that SimpleMDE has the same issue. First we have to understand that in JavaScript we use two parameters to determine which modifier key has been pressed and those are:

  • key

    • Ctrl
    • Alt
    • AltGr (right alt)
  • Location

    • Left
    • Right

If we press AltGr using standard English (US) keyboard then all browsers will detect:
Key 'Alt' is down. Location: Right

However if we press AltGr using Polish (programmers) or Romanian keyboards then js will detect:

  • In Edge and Firefox
    Key 'Control' is down. Location: Left
    Key 'Alt' is down. Location: Right
  • In Chrome
    Key 'Control' is down. Location: Left
    Key 'AltGraph' is down. Location: Right

So the solution I think will be to check not only for key that is being pressed but also for its location. In our case the numbered list should be triggered by:

Ctrl + Alt (only left) +L

Useful links

Snippet to test keypresses
Numeric key locations

Thanks!

@JohnONolan
Copy link
Member

Copied proposed solution to simplemde repo - this isn't something to track here

@PaszaVonPomiot
Copy link
Author

@JohnONolan it is unfortunate that you are closing this even for tracking as it is blocker for Poland and Romania. I mean we can't just stop using "ł" character and I see no resonable workaround so far.

@kevinansfield
Copy link
Contributor

@PaszaVonPomiot it's tracked in your issue in SimpleMDE which is where this needs to be fixed, keeping multiple issues open means that communication gets split and comments such as yours above don't end up in the right place. Core team monitors our 3rd party deps as well as the core repos

@PaszaVonPomiot
Copy link
Author

It appears that upstream markdown editor development has halted. Any ideas where to go from here?

@JohnONolan
Copy link
Member

JohnONolan commented Jul 26, 2018

Yep. You could fix it, or find someone else to fix it for you, and open a pull request to SimpleMDE.

@TryGhost TryGhost locked as resolved and limited conversation to collaborators Jul 26, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with
Projects
None yet
Development

No branches or pull requests

4 participants