Open MythicManiac opened 7 years ago
Ok, I'll consider implementing an option for this in the next minor release, that is v2.1.
To add to the discussion, using [
and ]
for indentation prevents typing in links.
Thanks for the awesome library! I was just about to ask how to easiest do this when I found this. Having tabs appear when switching browser tabs on the keyboard is highly frustrating, so a big 👍 for this.
OK I decided to hack something for myself, if it's a suitable patch I could add tests and make a PR out of it: https://github.com/jaywink/django-markdownx/commit/8b84886d3cbb768410110ae81958ad6018f7a0fe
The weird thing though, when I set MARKDOWNX_DISABLE_KEYS = True
in my settings, I only get data-markdownx-disable-keys=""
in the HTML element attrs. I would have investigated more, but since I copied the implementation from editor resize, I tried that and the same result. If I set MARKDOWNX_DISABLE_KEYS = "true"
things work. What am I doing wrong or is something broken on master?
Let me know if this patch is acceptable, otherwise I'll keep it for myself until the feature lands here later 👍
I realized after doing the above that I can just check whether CTRL is pressed at the same time and always ignore TAB in that case. This fixes everything I have against the hotkeys for me. PR #85 filed for consideration.
Can still clean the "disable keys" commit if that is seen as a good addition, though personally I wont be using it after all.
Currently the markdown editor widget eats the tab keypress in a way that prevents element focus change. This seems to be intended behaviour as a tab character is inserted.
There should be a way to opt-out of this behaviour and instead use tab for changing the focused element like normally. Right now the only way to opt-out seems to be by overriding the entire javascript file with a modified version of it.