Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RN Mobile] Unsupported block bottom sheet is triggered when device is rotated #13052 #25873

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/block-library/src/missing/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class UnsupportedBlockEdit extends Component {
super( props );
this.state = { showHelp: false };
this.toggleSheet = this.toggleSheet.bind( this );
this.closeSheet = this.closeSheet.bind( this );
guarani marked this conversation as resolved.
Show resolved Hide resolved
this.requestFallback = this.requestFallback.bind( this );
}

Expand All @@ -40,6 +41,12 @@ export class UnsupportedBlockEdit extends Component {
} );
}

closeSheet() {
this.setState( {
showHelp: false,
} );
}

componentWillUnmount() {
if ( this.timeout ) {
clearTimeout( this.timeout );
Expand Down Expand Up @@ -123,7 +130,7 @@ export class UnsupportedBlockEdit extends Component {
<BottomSheet
isVisible={ this.state.showHelp }
hideHeader
onClose={ this.toggleSheet }
onClose={ this.closeSheet }
onModalHide={ () => {
if ( this.state.sendFallbackMessage ) {
// On iOS, onModalHide is called when the controller is still part of the hierarchy.
Expand Down