WordPress / wporg-parent-2021

17 stars 10 forks source link

Search box active and focus styles #117

Closed adamwoodnz closed 7 months ago

adamwoodnz commented 9 months ago

The focus, active, and focus+active states for the search box is missing.

Focus:

image

Focus + active, note that this also causes a layout shift:

image

Originally posted by @adamwoodnz in https://github.com/WordPress/wporg-developer/issues/342#issuecomment-1819790374

ryelle commented 8 months ago

Is this an issue just on specific pages or browsers? I see the focus state just fine when using search here https://developer.wordpress.org/plugins/, for example.

Screenshot 2024-01-04 at 5 24 13 PM

The state is set on focus-visible (which should be true for these cases), but that does mean if you're testing with dev tools, toggling :focus won't work.

I do see the layout shift on click, so that's an issue regardless.

adamwoodnz commented 8 months ago

I'm not sure how @jasmussen discovered it, so I'm not sure about behaviour for a typical user, but I can repro by long tapping with my trackpad:

search active

And in devtools with active + focus:

Screenshot 2024-01-05 at 11 43 04 AM

ryelle commented 8 months ago

I must always just test with my keyboard, because you're right, clicking the button doesn't add the outline. Well, switching back to :focus for the button should fix that.