Skip to content

Block-level element bindings not updating when visibility is hidden or collapsed (in Firefox) #6708

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

Closed
sxxov opened this issue Sep 4, 2021 · 4 comments

Comments

@sxxov
Copy link

sxxov commented Sep 4, 2021

Describe the bug

What is expected:

  • Block-level element bindings (clientHeight, clientWidth, offsetHeight, offsetWidth) update regardless of visibility & browser.

What happens instead:

  • On Firefox (tested on stable 91.0.2 & dev 92.0b9), they update only when visibility is not hidden or collapsed.
  • On Chrome (tested on stable 92.0.4515.159 & dev 95.0.4630.1) & Edge (tested on stable 93.0.961.38), they update regardless of visibility's value.

Reproduction

https://svelte.dev/repl/bacc64f09063438db938745594c69d4c?version=3.42.4

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 AMD Ryzen 9 4900HS with Radeon Graphics
    Memory: 3.00 GB / 15.42 GB
  Binaries:
    Node: 14.17.5 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (93.0.961.38)
    Internet Explorer: 11.0.19041.906

Severity

annoyance

@sxxov
Copy link
Author

sxxov commented Sep 4, 2021

For any passerbys, you may replace visibility: hidden/collapsed with:

opacity: 0;
pointer-events: none;

@Prinzhorn
Copy link
Contributor

Prinzhorn commented Sep 4, 2021

Another edge case, related

https://bugzilla.mozilla.org/show_bug.cgi?id=1295245
#4233
#6127
#5524

@sxxov
Copy link
Author

sxxov commented Sep 4, 2021

https://bugzilla.mozilla.org/show_bug.cgi?id=1295245

"Opened 5 years ago"

The bug's old enough to go to kindergarten. I guess we'll just have to deal with it for now.

@Rich-Harris
Copy link
Member

It looks like this was fixed in Firefox at some point — the REPL above works, and it works in Svelte 5, so I'll close this

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

3 participants