Commit 1ed0cf2f authored by Shen Chang's avatar Shen Chang

fix(createStoreElement.ts): Change `display: none` to `visibility: hidden;...

fix(createStoreElement.ts): Change `display: none` to `visibility: hidden; opacity: 0; position: abs
parent 25e3cf17
{
"name": "react-keep-alive",
"version": "1.2.1",
"version": "1.2.2",
"description": "Package will allow components to maintain their status, to avoid repeated re-rendering.",
"author": "Shen Chang",
"homepage": "https://github.com/Sam618/react-keep-alive",
......
......@@ -3,7 +3,12 @@ import {prefix} from './createUniqueIdentification';
export default function createStoreElement(): HTMLElement {
const keepAliveDOM = document.createElement('div');
keepAliveDOM.dataset.type = prefix;
keepAliveDOM.style.display = 'none';
keepAliveDOM.style.visibility = 'hidden';
keepAliveDOM.style.opacity = '0';
keepAliveDOM.style.position = 'absolute';
keepAliveDOM.style.top = '0';
keepAliveDOM.style.left = '0';
keepAliveDOM.style.zIndex = '-1';
document.body.appendChild(keepAliveDOM);
return keepAliveDOM;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment