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

Screen getting stuck, when used with conditional display none css property #117

Open
prakhartech opened this issue Nov 20, 2024 · 0 comments

Comments

@prakhartech
Copy link

https://codesandbox.io/p/sandbox/react-wordcloud-responsive-forked-hvhqsy
`function App() {
const [hide, setHide] = React.useState(false);
return (


<div onClick={() => setHide(!hide)}>Buttion

  <div
    style={{
      width: "100%",
      height: "100%",
      display: hide ? "none" : "block",
    }}
  >
    <ReactWordcloud words={words} />
  </div>
</div>

);
}`

I was using ReactWordCloud in my project where use case was, on some state change, I want to hide a page which also contains my ReactWordCloud, and to hide it I am using display: none property of css but when I am changing it back to display: block my screen is getting stuck.
To clear out any doubts of my code, I tried it in the codeSandbox which I mentioned above, but it is showing the same behaviour.
I know the workaround it, but it took me a while to find out that what was causing the actual issue in my screen. So it would be great if this could be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant