Skip to content

Commit

Permalink
fix(components/molecule/modal): Do not launch multiple animations on …
Browse files Browse the repository at this point in the history
…Open/Close
  • Loading branch information
Ferran Simon authored and Ferran Simon committed Apr 18, 2024
1 parent 1744df3 commit 2dae5bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/molecule/modal/src/MoleculeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const MoleculeModal = forwardRef(
ev => {
ev && ev.stopPropagation()
toggleWindowScroll(false)

if (!isPageScrollable) enableScrollPage()

onClose()
Expand Down Expand Up @@ -128,11 +127,11 @@ const MoleculeModal = forwardRef(
const wrapperClassName = cx(suitClass(), {
'is-static': !withAnimation,
'is-MoleculeModal-open': isOpen,
[suitClass({element: 'out'})]: isClosing
[suitClass({element: 'out'})]: isClosing && !isOpen
})

const dialogClassName = cx(suitClass({element: 'dialog'}), {
[suitClass({element: 'dialog--out'})]: isClosing,
[suitClass({element: 'dialog--out'})]: isClosing && !isOpen,
[suitClass({element: 'dialog--fit'})]: fitContent,
[suitClass({element: `dialog--size-${size}`})]: !!size,
[suitClass({element: 'dialog--visible-overflow'})]: isOverflowVisible
Expand Down

0 comments on commit 2dae5bc

Please sign in to comment.