Skip to content

Commit 85e1b00

Browse files
elissa-matsushitajraff
authored andcommitted
fix(core-notification): fix component resizing
adding event listener so height is adjusted properly
1 parent d33b926 commit 85e1b00

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/Notification/Notification.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,12 @@ class Notification extends React.Component {
7474

7575
componentDidMount() {
7676
if (this.props.dismissible) {
77-
this.adjustContentHeight()
77+
window.addEventListener('resize', this.adjustContentHeight)
7878
}
7979
}
8080

81-
componentDidUpdate() {
82-
if (this.props.dismissible) {
83-
this.adjustContentHeight()
84-
}
81+
componentWillUnmount() {
82+
window.removeEventListener('resize', this.adjustContentHeight)
8583
}
8684

8785
adjustContentHeight = () => {

0 commit comments

Comments
 (0)