Drawer: will-change stays on the content and backdrop while the drawer is idle

Open
#3,719 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Find the drawer implementation and inspect where will-change is applied to its content and backdrop; the issue does not name specific files or tests. Reproduce by opening a drawer and inspecting both elements after it settles. Done when will-change is present only during swipes or animations and returns to auto while idle.

Written by the indexing model from the issue text.

Description

🐛 Bug report

An open drawer keeps will-change on its content (transform) and backdrop (opacity) the whole time it's open, not only while it swipes or animates.

That keeps composited layers alive while nothing moves. We noticed it in full-page screenshots, where Chromium skipped the drawer's content below the fold. We override it with style={{ willChange: "auto" }}.

💥 Steps to reproduce

  1. Open a drawer and let it settle.
  2. Inspect the content and backdrop. Both still carry will-change.

💻 Link to reproduction

No sandbox yet. Any drawer example shows the inline style.

🧐 Expected behavior

will-change is set only while the drawer swipes or animates, then goes back to auto.

🌍 System information

Software Version(s)
Zag Version 1.49.0, and 2.0.0-next.4
Browser Any
Operating System Any

🧢 Your Company/Team

IQ Industries

Dominant language
TypeScript
Stars
5.3k
Forks
320
Avg merge
1d 22h
Merged PRs (30d)
60

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from chakra-ui/zag

All issues in chakra-ui/zag

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.