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

Compositionend can not find correct mutations #3300

Open
WongYAQi opened this issue Feb 25, 2021 · 0 comments · May be fixed by #3301
Open

Compositionend can not find correct mutations #3300

WongYAQi opened this issue Feb 25, 2021 · 0 comments · May be fixed by #3301
Assignees

Comments

@WongYAQi
Copy link

I found that Scroll.batchEnd could not always record the recorret mutations when fire compositionend event.

Steps for Reproduction
0. all steps below should type except english to make compositionend function fired.

  1. type "###" + something in editor, then press "enter"
  2. ctrl + A, and press "del"
  3. type repeat step one, and then press "enter"

Expected behavior:
new line should be append after what we typed

Actual behavior:
new line append before what we typed.
And I found that when second type "#", when batchend function fired, batch object is empty Array, but when first typed, there was an Array with three mutation record

  • remove br element
  • append text element
  • change characterData

Platforms:
Chrome browser, version 88.0.4324.182

Version:
2.0.0-dev.4

I has made some fix to make my program run correctly, but I don't think this is a good way. I think I should check the delete function to find out why mutation was not observed before batchend function fired

Scroll.prototype.batchEnd = function () {
  const mutations = this.batch;
  this.batch = false;
  this.update(mutations.length ? mutations : undefined);
}
@WongYAQi WongYAQi linked a pull request Feb 25, 2021 that will close this issue
@luin luin self-assigned this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants