Skip to content

Commit

Permalink
Fixed #2089 - Add 'toast' key to ZIndex option on PrimeReact api
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jun 6, 2021
1 parent 0b1779e commit 42627d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/toast/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export class Toast extends Component {
newMessages = this.state.messages ? [...this.state.messages, value] : [value];
}

this.state.messages.length === 0 && ZIndexUtils.set('toast', this.container, this.props.baseZIndex);

this.setState({
messages: newMessages
});

ZIndexUtils.set('toast', this.container, this.props.baseZIndex);
}
}

Expand Down Expand Up @@ -95,6 +95,8 @@ export class Toast extends Component {
}

onExited() {
this.state.messages.length === 0 && ZIndexUtils.clear(this.container);

this.props.onHide && this.props.onHide();
}

Expand Down

0 comments on commit 42627d9

Please sign in to comment.