-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Additional undo step created when editor is blurred while widget focused #3198
Comments
This issue is a little more fancy. In the steps above I blurred the editor to copy 2nd link and that was the moment when additional undo step was created. It happens only when widget is focused and editor is blurred. The visible drag handler (has some additional styles) is included in a snapshot created on blur and as this snapshot is different than the previous one it creates additional undo step. Can be tested on https://codepen.io/f1ames/pen/JQbNZq. See (errors in the console are irrelevant for this issue): |
FYI: this was originally reported for a Drupal CKEditor plugin that comes with a Widget: https://www.drupal.org/project/entity_embed/issues/3060245. Thanks @f1ames for investigating this! 🙏 |
Why is this not a problem for |
@wimleers it's connected with blurring editor and not dialog itself. It can be reproduced also on demo with My assumption is that if dialog somehow blurs the editor (but I think the default dialog logic doesn't do that) the additional undo step will be added. |
Another update to my previous #3198 (comment) - the additional snapshot is created when editor is focused after blurring. What happens is that when editor is focused (e.g. text clicked somewhere), for a very short time, widget regains fake selection (which triggers drag handler to show/blink) and then fake selection is removed due to selection change. This short widget focus (not 100% sure if it's the focus itself) triggers undo snapshot creation which contains visible drag handler. I confirmed it by locking/unlocking undo manager on widget focus/blur events - the snapshot is not created then. |
Type of report
Bug
Provide detailed reproduction steps (if any)
Double click embedded video and update its URL via dialog.Expected result
There is single undo step for video embedding.
Actual result
There are two undo steps for the video.
See #3198 (comment) below for detailed explanation.
Other details
4.11.4
/4.10.0
standard all
presetThe text was updated successfully, but these errors were encountered: