fix: elements would lose some states like scroll position because of "virtual parent" optimization (#427)

* fix: elements would lose some state like scroll position because of "virtual parent" optimization

* refactor: the bugfix code

bug: elements would lose some state like scroll position because of "virtual parent" optimization

* fix: an error occured at applyMutation(remove nodes part)

error message:
Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node
This commit is contained in:
Lucky Feng
2020-11-27 17:46:52 +08:00
committed by GitHub
parent 658999c6e0
commit 96e4bfdddd
4 changed files with 76 additions and 0 deletions

View File

@@ -466,3 +466,9 @@ export enum ReplayerEvents {
}
export type MaskInputFn = (text: string) => string;
// store the state that would be changed during the process(unmount from dom and mount again)
export type ElementState = {
// [scrollLeft,scrollTop]
scroll?: [number, number];
};