-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(modal): OpenCloseComponent emits when setting `--calcite-duration…
…-factor` to 0 (#5326) **Related Issue:** #5206 All (before)open/close events are now emitted on modal regardless of transition duration. Add the `onToggleUnanimatedComponent` function to the `openCloseComponent Interface` to query props on the `transitionEl`. Use that to get the `transition-duration` on the `openTransitionProp`, which in the case of modal it’s the `opacity`. This will allow us to emit the open/close and beforeOpen/beforeClose events in cases where `opacity` transition duration is set to 0. Because calling computed style forces a layout, we use `readTask()` instead which schedules a DOM-read task. The provided callback will be executed at the best moment to perform DOM reads without causing layout thrashing as per Stencil docs. Updated to rework `openCloseComponent Interface` to call one function instead of 3 separate calls in every component by removing connect/disconnect and event listener mapping logic and passing argument `once` to `.addEventListener` on `transitionEl` instead.
- Loading branch information
Showing
4 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters