Description
The applyThemeAttribute method in TabbedDemo.java currently calls setAttribute('theme', '') when the theme parameter is an empty string. According to Vaadin theming semantics, an empty string attribute is not the same as the attribute being absent — Flow distinguishes "attribute not set" (getAttribute() → null) from "attribute set but no tokens" (getThemeName() → empty string).
Current Behavior
When the theme is toggled off (dark mode unchecked), the code sets:
document.documentElement.setAttribute('theme', '')
This leaves an empty theme attribute on the document element.
Expected Behavior
When the theme parameter is empty, the attribute should be removed entirely:
document.documentElement.removeAttribute('theme')
Suggested Fix
Update applyThemeAttribute to check if the theme is empty and call removeAttribute('theme') instead of setAttribute('theme', '').
Context
Description
The
applyThemeAttributemethod inTabbedDemo.javacurrently callssetAttribute('theme', '')when the theme parameter is an empty string. According to Vaadin theming semantics, an empty string attribute is not the same as the attribute being absent — Flow distinguishes "attribute not set" (getAttribute() → null) from "attribute set but no tokens" (getThemeName() → empty string).Current Behavior
When the theme is toggled off (dark mode unchecked), the code sets:
This leaves an empty
themeattribute on the document element.Expected Behavior
When the theme parameter is empty, the attribute should be removed entirely:
Suggested Fix
Update
applyThemeAttributeto check if the theme is empty and callremoveAttribute('theme')instead ofsetAttribute('theme', '').Context