mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-29 19:03:41 +00:00
Replace unsafe willReceiveProps in modal_root
This commit is contained in:
parent
461d267574
commit
28a9492e53
|
|
@ -61,14 +61,6 @@ class ModalRoot extends PureComponent {
|
||||||
this.history = this.props.history || createBrowserHistory();
|
this.history = this.props.history || createBrowserHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
UNSAFE_componentWillReceiveProps (nextProps) {
|
|
||||||
if (!!nextProps.children && !this.props.children) {
|
|
||||||
this.activeElement = document.activeElement;
|
|
||||||
|
|
||||||
this.getSiblings().forEach(sibling => sibling.setAttribute('inert', true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
if (!this.props.children && !!prevProps.children) {
|
if (!this.props.children && !!prevProps.children) {
|
||||||
this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));
|
this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));
|
||||||
|
|
@ -85,9 +77,15 @@ class ModalRoot extends PureComponent {
|
||||||
|
|
||||||
this._handleModalClose();
|
this._handleModalClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.children && !prevProps.children) {
|
if (this.props.children && !prevProps.children) {
|
||||||
|
this.activeElement = document.activeElement;
|
||||||
|
|
||||||
|
this.getSiblings().forEach(sibling => sibling.setAttribute('inert', true));
|
||||||
|
|
||||||
this._handleModalOpen();
|
this._handleModalOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.children) {
|
if (this.props.children) {
|
||||||
this._ensureHistoryBuffer();
|
this._ensureHistoryBuffer();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user