Skip to content

Commit

Permalink
fix(421): re-enable body scroll when unmounting
Browse files Browse the repository at this point in the history
  • Loading branch information
rpearce committed May 10, 2023
1 parent 340cbbd commit 668b0e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/Controlled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ class ControlledBase extends Component<ControlledPropsWithDefaults, ControlledSt
}

componentWillUnmount() {
if (this.state.modalState !== ModalState.UNLOADED) {
this.bodyScrollEnable()
}
this.changeObserver?.disconnect?.()
this.imgElObserver?.disconnect?.()
this.imgEl?.removeEventListener?.('load', this.handleImgLoad)
Expand Down

0 comments on commit 668b0e4

Please sign in to comment.