WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

Plugin modal closes in responsive view when switching orientation #9399

Open afercia opened 6 years ago

afercia commented 6 years ago

When a plugin modal (or, better, any modal that opens from the Sidebar) is open and then the viewport width changes to something less than 782 pixels, the Sidebar automatically closes.

Since the Sidebar is not rendered any longer, the modal is not rendered as well and disappears.

This can happen on any mobile device when rotating the device from landscape (width larger than 782 pixels) from portrait (width smaller than 782 pixels). In the Chrome emulator, you can reproduce this emulating the iPad, iPad mini, or iPhone X.

I'd tend to think it's a serious usability issue, as it may cause loss of data entered in a form in the modal, not to mention potential confusion for users.

jorgefilipecosta commented 5 years ago

Thank you for reporting this issue. I verified the problem in my tests. I guess the ideal solution would be to not close the sidebar if one of its elements (or its popover) contains focus?

afercia commented 5 years ago

@jorgefilipecosta thanks for the ping. Yes, that seems a good option.

On the other hand, the problem happens also when operating normally in the sidebar, for example:

This is a bit annoying and probably needs to be better considered. Up to designers, I guess 🙂