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

Triggering Undo (Ctrl + Z) in Paragraph with inline formatting can move cursor unexpectedly #3524

Closed
ephox-mogran opened this issue Nov 16, 2017 · 5 comments
Labels
Needs Decision Needs a decision to be actionable or relevant [Type] Bug An existing feature does not function as intended
Milestone

Comments

@ephox-mogran
Copy link
Contributor

Issue Overview

The caret representing where the user is typing is being reset back to the start of the block when triggering an undo inside a paragraph (Editable) if there are inline formatting elements (bold etc.). If you press Undo again, it often goes back to the right location.

Note, this is a TinyMCE bug. We will log it in the system, and let you know when it is fixed.

Steps to Reproduce (for bugs)

  1. Create a new block (paragraph)
  2. Type some words
  3. Trigger bold with the keyboard (Ctrl + B)
  4. Type some more words
  5. Toggle off bold with keyboard (Ctrl + B)
  6. Type some more words
  7. Repeat a few times
  8. Trigger Undo with Ctrl + Z a few times and watch the cursor

Note, if on a Mac, use Cmd instead of Ctrl.

Expected Behavior

The cursor moves to just after the last word typed in the history.

Current Behavior

The cursor jumps back to the start of the block on the first undo, then to the right place on the second undo, then to the start of the block on the third undo etc.

Possible Solution

This will be solved inside TinyMCE's undo manager and caret positioning code.

@ephox-mogran ephox-mogran added [Component] TinyMCE [Type] Bug An existing feature does not function as intended labels Nov 16, 2017
@karmatosed karmatosed added this to the Merge Proposal milestone Jan 25, 2018
@aduth
Copy link
Member

aduth commented Feb 28, 2018

@iseulde Do you know if this had been improved in recent improvements to the Undo history? (#4956)

@ellatrix
Copy link
Member

ellatrix commented Mar 6, 2018

No, actually this will be worse for every action now because we don't store caret position at all with our history records (yet). It's a good question whether we want to do this or not.

@ellatrix
Copy link
Member

As commented last time, I think we need a decision here if we want to store caret position in history. Ds this something urgent? Need to be looked at before merge or not?

@ellatrix ellatrix added the Needs Decision Needs a decision to be actionable or relevant label Apr 23, 2018
@ellatrix
Copy link
Member

Actually these last comments are different form what is reported, but the change in how we handle history makes this irrelevant now. Caret position will not move if you loop through history.

@mtias
Copy link
Member

mtias commented May 8, 2018

Let's close this for now. We can revisit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Decision Needs a decision to be actionable or relevant [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants