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

Inconsistent cursor position when switching between Markdown and WYSWIG editor modes #3294

Open
lincolnturley opened this issue Feb 13, 2025 · 0 comments
Labels

Comments

@lincolnturley
Copy link

lincolnturley commented Feb 13, 2025

Describe the bug

When switching from WYSIWYG to Markdown editor modes, the cursor position is updated to the beginning of the next paragraph.
When switching from Markdown to WYSIWYG editor modes, the cursor position is updated to the end position of the current paragraph.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://ui.toast.com/tui-editor'
  2. Delete all existing text.
  3. Set content to
    asdf
    asdf
    asdf
    asdf

asdf
asdf
4. Place the cursor at the very beginning of the content.
5. Switch back and forth between WYSIWYG and Markdown modes. Observe that the cursor position will toggle between the end of the current line (when switching to WYSIWYG mode) and the beginning of the next line (when switching to Markdown mode)
6. Above behavior will continue until and empty line is reach. When the cursor is placed on an empty line in Markdown mode and switched to WYSIWYG mode, the cursor selection will change to the end of the content.

Expected behavior

Expect the cursor position to remain consistent when switching between editor modes.

Screenshots

Start position (Markdown mode):
Image

Switch to WYSIWYG Cursor moves to end of line:
Image

Switching back to Markdown mode places cursor at beginning of next line:
Image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Edge, Chrome
  • Version: 3.2.2

Smartphone (please complete the following information):

  • Device: Pixel 6a
  • OS: Android 15
  • Browser: Chrome
  • Version: 3.2.2

Additional context

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant