benrbray / prosemirror-math

Schema and plugins for "first-class" math support in ProseMirror!
https://benrbray.com/prosemirror-math/
MIT License
245 stars 35 forks source link

Problem with caret position of math_inline in RTL #41

Open abisar opened 2 years ago

abisar commented 2 years ago

When the editor direction is rtl, caret position acts wrong in inline mode and makes it unusable. Pressing left arrow key (or right) doesn't work correctly and gets stuck in a loop. It's easy to reproduce: tuy5y5y5y

I tried to change updateCursorPos internally but didn't get anywhere. How can I change the cursorSide in tiptap2? I'm using the example from here.

benrbray commented 2 years ago

Thank you for reporting! I believe there are a few factors at play here where LTR is hard-coded as an assumption. I may be able to fix this by having an RTL config flag, and reversing the relationship between document position and direction whenever the flag is set. I will see if a simple fix is possible.