You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a <select> element. And I've set the color theme on the <html> element using data-bs-theme attribute.
In desktop browsers (Chrome, Edge, Safari, Firefox) the <select> is displayed correctly:
✅dark theme - dark <select>'s menu
✅light theme - light <select>'s menu
In mobile browsers (Chrome, Safari, Firefox) the menu of the <select> element seems to always be drawn according to the system's color theme, completely ignoring the data-bs-theme setting:
✅dark theme - dark <select>'s menu
❌light theme - dark<select>'s menu
I'm wondering if it can be fixed, or if it's the limitation of the browsers that cannot be overcome.
If latter, then it would be useful to have the documentation on color modes stating this limitation - save developers the trouble of figuring this out and preventing situations similar to the described one from happening in the first place🙌
Reduced test cases
Add <select> element:
<selectclass="form-select" aria-label="Default select example"><optionselected>Open this select menu</option><optionvalue="1">One</option><optionvalue="2">Two</option><optionvalue="3">Three</option></select>
Set the color theme to dark and check how <select>'s menu is displayed in desktop and mobile browsers:
<htmldata-bs-theme="dark">
Set the color theme to light and check how <select>'s menu is displayed in desktop and mobile browsers:
<htmldata-bs-theme="light">
What operating system(s) are you seeing the problem on?
Android, iOS
What browser(s) are you seeing the problem on?
Chrome, Safari, Firefox
What version of Bootstrap are you using?
v5.3.3
The text was updated successfully, but these errors were encountered:
Hi @andreimilto , changing the color of a element in mobile browsers is tricky. Mobile browsers use their own default styles, which often override custom CSS. This makes it hard to change the look of the dropdown menu. The best option for now is to create a custom select dropdown using HTML, CSS, and JavaScript, which will give you full control over the design. Hopefully, there will be an easier solution for this in the future!
Prerequisites
Describe the issue
I have a
<select>
element. And I've set the color theme on the<html>
element usingdata-bs-theme
attribute.In desktop browsers (Chrome, Edge, Safari, Firefox) the
<select>
is displayed correctly:✅dark theme - dark
<select>
's menu✅light theme - light
<select>
's menuIn mobile browsers (Chrome, Safari, Firefox) the menu of the
<select>
element seems to always be drawn according to the system's color theme, completely ignoring thedata-bs-theme
setting:✅dark theme - dark
<select>
's menu❌light theme - dark
<select>
's menuI'm wondering if it can be fixed, or if it's the limitation of the browsers that cannot be overcome.
If latter, then it would be useful to have the documentation on color modes stating this limitation - save developers the trouble of figuring this out and preventing situations similar to the described one from happening in the first place🙌
Reduced test cases
<select>
element:dark
and check how<select>
's menu is displayed in desktop and mobile browsers:light
and check how<select>
's menu is displayed in desktop and mobile browsers:What operating system(s) are you seeing the problem on?
Android, iOS
What browser(s) are you seeing the problem on?
Chrome, Safari, Firefox
What version of Bootstrap are you using?
v5.3.3
The text was updated successfully, but these errors were encountered: