You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Website: Use modal for Site settings form on mobile – mobile Safari l… (#1885)
Replaces the site settings dropdown with a modal that remains open until
the user:\
- Clicks outside of the dropdown
- Clicks the dropdown toggle button
- Presses the Escape key
Why?
Mobile Safari has a bug where selecting a `<select>` option moves the
focus back to `<body>`. Unfortunately, this also closes the
`@wordpress/components`
dropdowns which react to the `onFocusOutside` callback.
## Alternatives tried
* Using a Dropdown with a backdrop layer that closes it on tap. I
couldn't get it to work without the same focus issue also affecting it,
even after overwriting the `open` property. As it turns out, the
`<Dropdown>` component is hardwired to call `onToggle()` both when the
`x` is pressed AND when the focus is lost.
## Testing instructions
* Open Playground on an iPhone or iPhone simulator
* Confirm you can open the site settings form and change selection
without closing the form
* Confirm that submitting the form closes the modal
* Confirm you're still getting the dropdown on desktop
0 commit comments