Transition: Fix moving cached virtual elements within tree

This commit is contained in:
Alexander Zinchuk 2022-03-05 18:06:26 +01:00
parent eb0e304ff8
commit 9fb3b71e58
2 changed files with 5 additions and 6 deletions

View File

@ -11,8 +11,8 @@
"deploy:production": "npm run build:production && git add -A && git commit -a -m '[Build]' --no-verify && git push",
"print_version": "node -p -e \"require('./package.json').version\"",
"inc_version": "echo $((`cat .patch-version` + 1)) > .patch-version && echo \"$(node -p -e \"require('./package.json').version.match(/^\\d+\\.\\d+/)[0]\").$(cat .patch-version)\"",
"lint": "tsc && stylelint \"**/*.{css,scss}\" && eslint . --ext .ts,.tsx --ignore-pattern src/lib/gramjs",
"lint:fix": "stylelint . && npm run lint -- --fix",
"check": "tsc && stylelint \"**/*.{css,scss}\" && eslint . --ext .ts,.tsx --ignore-pattern src/lib/gramjs",
"check:fix": "npm run check -- --fix",
"gramjs:tl": "node ./src/lib/gramjs/tl/generateModules.js",
"gramjs:lint:fix": "eslint ./src/lib/gramjs --fix",
"test": "cross-env APP_ENV=test jest --verbose --forceExit",

View File

@ -248,9 +248,8 @@ const Transition: FC<TransitionProps> = ({
}, [shouldRestoreHeight, children]);
const renders = rendersRef.current;
const collection = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);
const contents = collection.map((key) => {
const renderKeys = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);
const contents = renderKeys.map((key) => {
const render = renders[key];
if (!render) {
return undefined;
@ -270,7 +269,7 @@ const Transition: FC<TransitionProps> = ({
ref={containerRef}
id={id}
className={buildClassName('Transition', className, name)}
teactFastList={!renderCount && !shouldCleanup}
teactFastList={!renderCount}
>
{contents}
</div>