-
Notifications
You must be signed in to change notification settings - Fork 151
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
typing "<space><space>" in empty paragraph removes the whitespace #292
Comments
Does not happen on Safari 9.0.2 or Firefox 42.0 and 43.0.4. Observed on Chrome 48.0.2564.79 beta and 47.0.2526.106 (stable) |
This is caused when there is a listener for "DOMSubtreeModified" added to the window (even if its callback is a no-op). It's reproducible in all browsers mentioned above. It originally appeared to be isolated to Chrome because I had an extension that added the listener in question on Chrome. Adding a DOMSubtreeModified listener changes the batching of mutation events that mobiledoc-kit's MutationObserver sees. When no such listener is attached and a user types a space at the end of a text node, the browser replaces that space with an When the listener is attached, however, the browser fires the mutation observer once for each mutation, rather than once at the end of all 3 mutations. This means the editor To fix this we will add an explicit listener for typing a space (like we already do for |
Refactor text expansion code to happen on keyDown of the `trigger` rather than using setTimeout and reparse Fixes #292
Refactor text expansion code to happen on keyDown of the `trigger` rather than using setTimeout and reparse Fixes #292
Refactor text expansion code to happen on keyDown of the `trigger` rather than using setTimeout and reparse Fixes #292
On Chrome, typing two spaces in a row in an empty paragraph causes them to both be removed and the paragraph is rerendered as an empty paragraph.
The text was updated successfully, but these errors were encountered: