Repository navigation
Commit 60dd10f
committed
fix(material/dialog): prevent visual jump by removing open class together with closing class
When _startExitAnimation() is called, mdc-dialog--open was previously removed synchronously while mdc-dialog--closing was scheduled in a requestAnimationFrame callback. When close() is called from within a requestAnimationFrame callback (such as during zoneless change detection scheduling or effect reactions), the nested rAF is deferred to the next frame. During that intermediate frame, the dialog container renders with neither class, applying the base un-opened styles (scale(0.8) / opacity: 0) and causing the dialog surface to visibly shrink and then snap back.
Remove mdc-dialog--open and add mdc-dialog--closing together within the requestAnimationFrame callback so the container transitions directly from the open state to the closing state without an intermediate class-less frame.
Fixes #34123
Signed-off-by: Abdul karim mia <97598943+abdul-karim-mia@users.noreply.github.com>1 parent 9187233 commit 60dd10f
2 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| |||
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
| 151 | + | |
146 | 152 | | |
147 | 153 | | |
148 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2298 | 2298 | | |
2299 | 2299 | | |
2300 | 2300 | | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
2301 | 2320 | | |
2302 | 2321 | | |
2303 | 2322 | | |
| |||
0 commit comments