Skip to content

Fix dark/light theme showing as selected when "auto" is chosen

Problem: If the user has chosen "Browser default" (or auto) for the theme, the theme selection menu will still instead show light or dark as selected instead of "Browser default".

This is a regression introduced when the custom browser dark / light mode selection got replaced with Vue's default on the Vue 3 upgrade in !1768 (merged).

Solution: Set emitAuto = True in Vue's color mode config. This causes auto to be returned as the value when querying the current value of the theme. This fixes setting the proper menu entry to the selected mode.

Note: This fixes the issue, but there is a potential downside: If some code needs to know whether the UI is in dark or light mode right now, querying the theme value might give only "auto" as result. But currently this is not a requirement anywhere in the code. If this would be needed in the future some mechanism to get the currently active theme would need to be added.

Merge request reports