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

[Dropdown] Inconsistent appearance #80

Open
hohaicongthuan opened this issue Oct 11, 2023 · 4 comments
Open

[Dropdown] Inconsistent appearance #80

hohaicongthuan opened this issue Oct 11, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@hohaicongthuan
Copy link
Contributor

The visual appearance of the dropdown varies a lot across different OSes and browsers. Here are some examples:

OS | Browser Image OS | Browser Image
Windows 7's dropdown dropdown menu reference Windows 11 | Brave Win11_Brave
Windows 10 | Brave Win10_Brave Linux (Kubuntu) | Brave Kubuntu_Brave
Windows 10 | Edge Win10_Edge Windows 10 | Firefox Win10_Firefox

(There's more but you get the idea)

@khang-nd
Copy link
Owner

khang-nd commented Oct 14, 2023

This is due to the fact that the dropdown component is merely styling the browser's default select element. To achieve a consistent cross-browser dropdown box, we'd probably need to make a pseudo dropdown element and utilize some sort of CSS combinators (e.g. > or +). Also, I reckon it would still be useful to keep the select element support for simplicity or as a fallback behavior.

@wll8
Copy link

wll8 commented Nov 10, 2023

https://github.com/necolas/normalize.css

Will the problem be alleviated if normalize is used?

@khang-nd
Copy link
Owner

khang-nd commented Nov 10, 2023

@wll8 Unlikely, the main concern is the dropdown box's appearance e.g the borders, shape, shadow, background color... being not consistent, and normalize.css only helps standardize the fonts (line 163-168) and doesn't touch any of the aforementioned properties.

With my limited CSS knowledge, I don't think there's an easy way to address these properties of a native select element, best I might do is as I commented above.

@khang-nd khang-nd added the enhancement New feature or request label Nov 10, 2023
@liam-mills
Copy link
Contributor

Hi @khang-nd,

Just wanted to make you aware of the selectlist (previously selectmenu) proposal by Open UI. As it's still in a proposal state it isn't supported on any browsers currently (with the exception of Chrome under an experimental flag). But if this proposal becomes standard then we could aim to style the dropdown menu accordingly with the Windows 7 format; fingers crossed.

For your reading:

https://open-ui.org/components/selectlist/
https://caniuse.com/?search=selectlist
https://css-tricks.com/the-selectmenu-element/

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants