Skip to content

Commit

Permalink
fix: reduced motion side panel close (carbon-design-system#11608)
Browse files Browse the repository at this point in the history
Co-authored-by: Anna Wen <54281166+annawen1@users.noreply.github.com>
  • Loading branch information
lee-chase and annawen1 committed Mar 5, 2024
1 parent ddd1277 commit 14ced40
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,14 @@ class CDSSidePanel extends HostListenerMixin(LitElement) {
private _checkSetOpen = () => {
const { _sidePanel: sidePanel } = this;
if (sidePanel && this._isOpen) {
// wait until the side panel has transitioned off the screen to remove
sidePanel.addEventListener('transitionend', () => {
if (this._reducedMotion) {
this._isOpen = false;
});
} else {
// wait until the side panel has transitioned off the screen to remove
sidePanel.addEventListener('transitionend', () => {
this._isOpen = false;
});
}
} else {
// allow the html to render before animating in the side panel
this._isOpen = this.open;
Expand Down

0 comments on commit 14ced40

Please sign in to comment.