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

Search: Autocomplete color contrast in Chrome #4808

Closed
2 tasks done
SimonFinney opened this issue Dec 3, 2019 · 6 comments · Fixed by #4891
Closed
2 tasks done

Search: Autocomplete color contrast in Chrome #4808

SimonFinney opened this issue Dec 3, 2019 · 6 comments · Fixed by #4891

Comments

@SimonFinney
Copy link
Contributor

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Cancel search icon button color contrast is off due to recently introduced skyblue background color for autofill in Chrome - https://support.google.com/docs/thread/4024179?hl=en

Search

@j1mie
Copy link
Contributor

j1mie commented Dec 3, 2019

There are two approaches to fixing this:

  1. Fix the icon fill for the offending pseudo classes
    .bx--search-input:-internal-autofill-selected ~ .bx--search-close { fill: currentColor; }

  2. Ensure that the background color of the clear button is no longer transparent.

I used the first option as a quick fix in our project, but I'm thinking now that I prefer the second option as a longer term fix because it doesn't involve going down the road of learning / overwriting strange browser-specific pseudo classes.

@abbeyhrt
Copy link
Contributor

HI @SimonFinney Thanks for bringing this to our attention! What browser are you finding this in and would you be able to provide a code sandbox reproducing this problem? At first glance, this issue seems to come from your implementation of the Search component. The icons in our Search component are black by default and pass color contrast with the new skyblue autofill color. Screen Shot 2019-12-12 at 11.18.43 AM.png

@abbeyhrt
Copy link
Contributor

Closing this since a solution is posted above! Re-open if anyone feels like the problem still needs to be addressed 👍

@SimonFinney
Copy link
Contributor Author

@abbeyhrt I believe this will be affected in darker themes, like gray 100, where the icon defaults to white. Unfortunately, I don't have the permissions to reopen this issue but it still exists.

@j1mie
Copy link
Contributor

j1mie commented Dec 13, 2019

Can confirm that this issue exists on Chrome 78, OSX. We should reopen this issue.

@abbeyhrt abbeyhrt reopened this Dec 13, 2019
@abbeyhrt
Copy link
Contributor

abbeyhrt commented Dec 13, 2019

@SimonFinney thanks for pointing that out! Reopening for further investigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants