filament icon indicating copy to clipboard operation
filament copied to clipboard

Select options look weird in Chrome on Windows

Open anthonyphysgun opened this issue 3 years ago • 42 comments

Package

filament/filament

Package Version

v3.0.0

Laravel Version

10.10

Livewire Version

No response

PHP Version

8.1

Problem description

Dropdowns don't have styling and appear fully white when on dark mode

Expected behavior

Them to be dark mode

Steps to reproduce

Make a dropdown on anything and it wont be styled

Reproduction repository

https://github.com/anthonyphysgun/filament-toggleissue

Relevant log output

No response

anthonyphysgun avatar Jul 21 '23 22:07 anthonyphysgun

env is windows on chrome - seems to be fine on macos

anthonyphysgun avatar Jul 21 '23 22:07 anthonyphysgun

@anthonyphysgun, could you share some screenshots of this? I have no idea what could be the cause of this. Also, since we're not on Windows, it's impossible for us to reproduce.

zepfietje avatar Jul 23 '23 09:07 zepfietje

https://discord.com/channels/883083792112300104/883083792653381695/1132064814949204008

anthonyphysgun avatar Jul 23 '23 14:07 anthonyphysgun

Oh you're talking about the select input. I thought you meant the dropdown component.

Pasting the image from your Discord message here as reference:

image

Most probably it's out of our control, as the options shown when focusing the select are just styled by the OS/browser.

Could you provide these additional details?

  1. Screenshot as above, but when using the Filament light theme.
  2. Screenshot of the options in a regular Filament select form component in light and dark theme.
  3. Screenshot of the unstyled HTML select in dark and light (e.g. from this page: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select).

As I can't reproduce the issue on macOS (Safari/Firefox/Chromium), I'm going to close this issue until further evidence (as outline in the list above) proves this actually is a Filament issue (which I'm pretty sure it's not, but never say never).

Let us know! 🙂

zepfietje avatar Jul 23 '23 17:07 zepfietje

image image

v2 vs v3

image Light Theme v3

image

anthonyphysgun avatar Jul 24 '23 16:07 anthonyphysgun

Okay so the inset is because the select is now wrapped in an affixes component that's also used for the forms select field to ensure consistency. So not a lot we can do there I think.

The remaining major issue would be that the select options background is white in dark mode?

zepfietje avatar Jul 24 '23 17:07 zepfietje

It's hard for me to debug as I'm not on Windows, but maybe you could try setting an actual background color on the select element?

Just a wild guess, but it might be that in v2 that select had a dark background color, whereas it's transparent in v3 since the affixes component handles the background.

zepfietje avatar Jul 24 '23 17:07 zepfietje

image

In my case chrome / ubuntu In the expanded Select field in Dark Mode, only the highlighted text is visible, the rest is white on a white background. Fresh installation. The first display of the expanded Select shows the text, but when the item is selected next time text disappears

qcol avatar Jul 25 '23 13:07 qcol

Could you try what I suggested in the comment above, @qcol?

maybe you could try setting an actual background color on the select element?

If you could share a screenshot of that, I can implement a fix.

zepfietje avatar Jul 25 '23 15:07 zepfietje

image

If you mean the console test, it looks like this in the screenshot. The text is now readable, but the corners look bad, the bottom border of the dropdown list is missing.

qcol avatar Jul 25 '23 16:07 qcol

Thanks!

The corners issue is caused by the select element overflowing the affixes component. That's required for the searchable select, but I can possibly add the rounding to the select itself for a default HTML select. I'd have to account for any affixes though, but I think I can make that work.

The remaining issue would then be the border. Could you look into the cause of that?

zepfietje avatar Jul 25 '23 16:07 zepfietje

There is no bottom border in the light theme either. As far as I can see the reason is the shadow effect?

image

qcol avatar Jul 25 '23 17:07 qcol

That shadow isn't applied by Filament though.

zepfietje avatar Jul 25 '23 18:07 zepfietje

Could you check if just a plain HTML select in a simple HTML file outside Filament looks the same?

zepfietje avatar Jul 25 '23 18:07 zepfietje

sure:

image

qcol avatar Jul 25 '23 19:07 qcol

Select with ->multiple() option looks correct:

image

qcol avatar Jul 25 '23 20:07 qcol

Hey, here: chrome / Filament v3.0.0-beta10 image

leandrocfe avatar Jul 25 '23 20:07 leandrocfe

Hey, here: chrome / Filament v3.0.0-beta10

Interesting. Windows? Mac? Linux?

qcol avatar Jul 25 '23 20:07 qcol

options do not scale when zoomed in with ctrl+ (->multiple() scales correctly)

image

qcol avatar Jul 25 '23 20:07 qcol

Ubuntu With zoom image

leandrocfe avatar Jul 25 '23 20:07 leandrocfe