-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix erroneous text after native insert #4529
Fix erroneous text after native insert #4529
Conversation
🦋 Changeset detectedLatest commit: f74c63e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
if (!NATIVE_OPERATIONS.get(editor)) { | ||
onFlushed?.() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The important bit, everything else in this method is a refactor (boy scout rule).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to merge this in 😄
Hey there, looks like there was a regression with deletion of selected fragments in Firefox. I've traced the regression back to this PR: Firefox.expanded.selection.crash.mp4This behaviour can be replicated in all versions of Firefox that I tested (I checked on Firefox 92, 91, and 90). |
Hi @clauderic. Are you sure this PR was the cause and not #3888? This PR was trying to fix a bug introduced by #3888. |
Hey @nemanja-tosic, I'm fairly certain it was this PR yes. The previous commits right up until this PR work fine in Firefox: Kapture.2021-09-24.at.17.00.56.mp4This isn't to say that your PR doesn't indeed fix a bug introduced by #3888, but it seems to have caused other regressions. |
That's ok, I'll take a look. There are several problems due to #3888 right now which I'm looking at as well. Thanks! |
Description
The code was backing out of a native insert if there are ops other than insert_text, but at that point the decision to preventDefault was already made. The PR takes into account the flush as well, and does a prevent default in case a flush has occured.
Issue
Fixes: #4527
Notes
Refactored asNative to record previous state and reset it in a finally clause. A variable is set, so the function should clean up after itself, to put it tersely. Also, captured the previous state of AS_NATIVE, as to account for potential nesting of the calls.
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)