-
Notifications
You must be signed in to change notification settings - Fork 58
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
[iOS] Redo history lost after adding link to text #2091
Comments
This is also present on Android, although the behavior is slightly different I think it's the same issue. Also, I noticed that Step 5 from the steps to reproduce can be omitted while still producing the bug. DebuggingThe bug stems from an extra undo entry being added to undo history in the Redux store right after adding links that set the "Open in new tab option". As an example, suppose a link is added to the letter "two" in the string "One two three". Here's the sequence of events:
Here's a diff of the entry that's added correctly to the undo history (on the left) and the entry (on the right) that's then added incorrectly to the undo history when the user sets the cursor after adding the link. You'll see the only significant difference is the position of the What makes me quite sure this is what breaks the redo button functionality as described in this issue, is that if I use the debugger to prevent this erroneous entry from being added, this error disappears. To prevent the entry from being added, I put a breakpoint inside the undo reducer and popped the extra entry off the There is a piece of code that's calling the undo reducer with an |
This ticket is not worked on at the moment so, I'll clear the assignee field to denote so. |
I reproduced this issue in the latest version of the editor |
Some initial findings: @guarani's comment has some very accurate information. I paired with @fluiddot on this for a bit, and we both confirmed that the Interestingly, when debugging the same behavior on the web, I noted that the Link.Attributes.Test.movMy next steps are:
The scope of the issue seems quite broad. For example, the undo/redo issues have been known within the manual test cases caveats for three years. It may be worth organizing all of the broader undo/redo issues together under a single issue if they are related, which I am happy to start. Open to feedback on how we might better organize this as a broader issue. 🙇 For reference, here are some of the other undo/redo issues that seem related (some are marked as complete as they are duplicates of each other):
|
Also, a follow-up on this question:
It does seem very much related to #2495. However, the difference in my testing on Android is that the redo history is preserved (when it is not on iOS), but on Android it is much more difficult to perform an undo action on a link that has been configured to Open in a New Tab. This aligns with the feedback already captured in #2495. So, while they seem very related, at the moment I do not think they are duplicate issues. |
It's interesting that this behavior can also be reproduced in the web version. I tried to reproduce this issue and undo/redo actions work as expected, adding a link to one of the words and checking Open in new tab option doesn't break the undo/redo history. I'm wondering what's the difference in this logic between platforms that only affects the native version. 🤔 |
I agree. It's also interesting that there are slight differences between iOS and the similar behavior on Android reported in #2495. Given that the web implementation works as expected, this seems to point to Aztec's handling of HTML attributes as the source of these differences between web, iOS, and Android. |
Hey @derekblank 👋 It looks like this issue was solved in WordPress/gutenberg#50460 if so, can we close this issue? Thanks! |
@geriux Yep, closing. 👍 |
Describe the bug
Redo is lost after redoing a link on rich-text.
To Reproduce
Steps to reproduce the behavior:
Open in new tab
option.Expected behavior
Redo should work redoing all changes that were undone previously.
Video
https://cloudup.com/cOPGvdNJnli
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: