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

Fix input colouring when autofill is on #2798

Merged
merged 8 commits into from
Feb 3, 2020

Conversation

andreadelrio
Copy link
Contributor

@andreadelrio andreadelrio commented Jan 27, 2020

Summary

When autofill is on in Chrome, it changes the styling of our input fields in both light and dark mode. Using CSS I've modified the styles that get applied in this scenario.

GIFs of Before vs After

before_autofill
after_autofill

And here's some screenshots...

Autofill on in light mode - current
image

Regular styling of input field - Light mode
image

Proposed fix in light mode
image

Autofill on in dark mode - current

image

Regular styling of input field - Dark mode

image

Proposed fix in dark mode

image

Note: I'm adding a border because I'm using box-shadow to be the background which would leave the input field without a border.

Like Ryan mentioned in #2469, this solution is hacky. According to references that I found (and that were mentioned in related issues), there doesn't seem to be any other way to fix this issue right now. This takes cares of the problem while we find a more solid solution.

Fixes #2469
Fixes #827

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • [x ] Checked in mobile
    - [ ] Checked in IE11 and Firefox
    - [ ] Props have proper autodocs
    - [ ] Added documentation examples
    - [ ] Added or updated jest tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@cchaos
Copy link
Contributor

cchaos commented Jan 30, 2020

This does fix the issue of not being able to see the icons in dark mode auto-fill. But it also gets rid of the highlight indicating that auto-fill is happening. I'm wondering if we should still add a bit more color or highlight back into it instead of making it the same as the normal state.

@ryankeairns ryankeairns removed their request for review January 30, 2020 22:59
@andreadelrio
Copy link
Contributor Author

This does fix the issue of not being able to see the icons in dark mode auto-fill. But it also gets rid of the highlight indicating that auto-fill is happening. I'm wondering if we should still add a bit more color or highlight back into it instead of making it the same as the normal state.

@cchaos That's a good catch. I've been looking into how this is handled elsewhere and maybe we shouldn't try to match the styling of fields w/autofill with the one in empty fields at all. Instead we'd simply fix what Chrome implements. Resulting in this:

image

image

What do you think? I think this really highlights the autofill which is what Chrome intends and it doesn't look bad.

@cchaos
Copy link
Contributor

cchaos commented Feb 1, 2020

I think that works great! Like you said, it's still Chrome's style of highlighting auto-fill but just fixes the coloring on our side.

src/global_styling/mixins/_form.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this specifically called out Chrome, but I checked in Chrome, Safari, and Firefox. Firefox is ok, it's readable but loses some of the input boundaries. Don't know what IE does, but could be something checked out real quick.

@andreadelrio
Copy link
Contributor Author

I know this specifically called out Chrome, but I checked in Chrome, Safari, and Firefox. Firefox is ok, it's readable but loses some of the input boundaries. Don't know what IE does, but could be something checked out real quick.

Thanks for checking in the other browsers. I tried to get autofill working locally on IE (in both Browserstack and VirtualBox) but had no luck. Closing this and we can fix IE if it's an issue in the future.

@andreadelrio andreadelrio merged commit 4f2e52f into elastic:master Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input fields turn white in dark mode upon using auto-complete Autofill too dark in dark mode
2 participants