-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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
- Flagged during review of PR feat: add getThemeAttribute and applyThemeAttribute methods AND remove!: remove deprecated methods and classes #127: feat: add getThemeAttribute and applyThemeAttribute methods AND remove!: remove deprecated methods and classes #127 (comment)
- Requested by: @javier-godoy
- This behavior existed in the previous implementation and is out of scope for PR feat: add getThemeAttribute and applyThemeAttribute methods AND remove!: remove deprecated methods and classes #127, which focuses on removing deprecated methods
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Inbox (needs triage)