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

fix: add hidden property to polymer based components #171

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

tomivirkki
Copy link
Member

@tomivirkki tomivirkki commented Dec 13, 2023

Description

Map falsy boolean properties as undefined to avoid them from rendering with the value false in the attribute, for example, <vaadin-button hidden="false">, which would actually evaluate as hidden being true due to it being a boolean attribute.

Add hidden property to Polymer-based components to have it not set as an attribute

Fixes #118

Type of change

Bugfix


useChaiPlugin(chaiDom);

describe('SideNav', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests for SideNav because it's LitElement based and behaves differently from the other, PolymerElement based components.

@tomivirkki tomivirkki changed the title fix: map falsy boolean properties as undefined fix: add hidden property to polymer based components Dec 13, 2023
@tomivirkki tomivirkki merged commit a3fe553 into main Dec 13, 2023
2 checks passed
@tomivirkki tomivirkki deleted the fix/boolean-attributes branch December 13, 2023 14:09
web-padawan pushed a commit that referenced this pull request Dec 15, 2023
Co-authored-by: Tomi Virkki <tomivirkki@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Components are always invisible when hidden property is used
3 participants