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

Unable to select colors on small screens #41894

Closed
jameskoster opened this issue Jun 23, 2022 · 9 comments · Fixed by #41929 or #49975
Closed

Unable to select colors on small screens #41894

jameskoster opened this issue Jun 23, 2022 · 9 comments · Fixed by #41929 or #49975
Assignees
Labels
[Feature] Colors Color management Mobile Web Viewport sizes for mobile and tablet devices [Type] Bug An existing feature does not function as intended

Comments

@jameskoster
Copy link
Contributor

jameskoster commented Jun 23, 2022

Description

On small screens, the color palette popover is hidden.

Step-by-step reproduction instructions

On a small screen:

  1. Select a block that can have colors applied, like Paragraph
  2. Open the Inspector (⇧⌘,)
  3. In the Color panel, click one of the buttons
  4. Observe that no color palette is revealed

Screenshots, screen recording, code snippet

color.mp4

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@jameskoster jameskoster added [Type] Bug An existing feature does not function as intended Mobile Web Viewport sizes for mobile and tablet devices [Feature] Colors Color management labels Jun 23, 2022
@carolinan
Copy link
Contributor

Can confirm, noticed this from my android phone yesterday (site running Gutenberg 13.5.0), thank you for opening the issue.

@annezazu
Copy link
Contributor

@aaronrobertshaw in case you have any insights here.

@aaronrobertshaw
Copy link
Contributor

aaronrobertshaw commented Jun 24, 2022

Thanks for the ping on this one 👍

This appears to have been a side-effect from the recent changes switching Popovers to use the floatingUI library (#40740). After that the popovers weren't repositioned automatically if they fell outside the viewport.

I've knocked up a quick fix in #41929. That will get the color controls popover visible and usable again. We can refine the positioning further in a follow-up as there is some ongoing work around this sort of issue for Tooltips. Whatever we come up with there, might inform how best to refine the positioning here.

While testing this I discovered the same issue exists for the border controls. Given that control can be split into multiple representing each side it's a little more involved. As such I've split a fix for that into a separate PR that can be iterated on independently (#41930).

@annezazu
Copy link
Contributor

Reopening this after receiving a report from @nomad-skateboarding-dev. Here's a video showing the current experience using WordPress 6.2:

color.palette.mov

@annezazu annezazu reopened this Apr 12, 2023
@aaronrobertshaw
Copy link
Contributor

Thanks for reopening the issue @annezazu 👍

Looks like this is a different, but similar, issue around popover positioning. I've re-tested as per the original issue replication steps and the previous fix holds.

I can also confirm the Global Styles palette edit color pickers are rendered outside the viewport. If we adopt as similar approach as the original issue fix, the popovers are visible again. The catch then is they will overlay the control that was clicked to trigger the popover.

I'm still working on how we might improve that. If no solution is forthcoming I'll try and land a quick fix to get the popovers at least visible.

@aaronrobertshaw
Copy link
Contributor

Unfortunately, it turns out when the color picker popover overlays a custom color control on small viewports, you are unable to select and change the custom color's name. That probably blocks that quick fix for the moment.

I'll continue to explore solutions in the next couple of days.

Screen.Recording.2023-04-20.at.4.49.33.pm.mp4

@annezazu
Copy link
Contributor

Thanks so much, Aaron, for diving in!

@nomad-skateboarding-dev

Thank you @annezazu ! 🙏

Thank you @aaronrobertshaw ! 🙏 I appreciate your time and effort on this, and even your first thought at the quick fix solution would have been a huge improvement if it had worked out. 🙌

@aaronrobertshaw
Copy link
Contributor

I have a draft PR (#49975) up that functionality fixes the palette popovers including moving them off the controls that trigger them. If the general approach is accepted, we should be able to land a fix fairly soon.

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Colors Color management Mobile Web Viewport sizes for mobile and tablet devices [Type] Bug An existing feature does not function as intended
Projects
None yet
6 participants