Skip to content

fix(attributes): preserve non-boolean hidden attribute values#5074

Open
rururux wants to merge 2 commits intocheeriojs:mainfrom
rururux:fix-hidden-attr-value
Open

fix(attributes): preserve non-boolean hidden attribute values#5074
rururux wants to merge 2 commits intocheeriojs:mainfrom
rururux:fix-hidden-attr-value

Conversation

@rururux
Copy link

@rururux rururux commented Feb 15, 2026

fixes: #5073

Changes

Previously, the .attr() method could not correctly retrieve the newly implemented until-found value for the hidden attribute. It would instead return "hidden" or undefined due to being treated strictly as a boolean attribute.
In this fix, I have removed hidden from the rboolean regex/variable to allow it to be handled as an enumerated attribute.

Testing

I have added a test case to ensure that the value of the hidden attribute can be correctly read from elements like <div hidden="until-found">.

Copy link
Member

@fb55 fb55 left a comment

Choose a reason for hiding this comment

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

Thanks @rururux! Could we still return a boolean if it is hidden, and extend the return type to "until-found"? Otherwise this will break old code.

@rururux
Copy link
Author

rururux commented Feb 22, 2026

@fb55
Thanks for the review! I’ve updated the code based on your feedback. Please take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Attribute value "until-found" for hidden attribute is incorrectly normalized

2 participants