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

Filter empty string classes #770

Merged
merged 4 commits into from
Dec 4, 2019
Merged

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Dec 3, 2019

Problem

When an empty string classname is used, Yew does not filter it and allows it to cause this DOMException:

Uncaught (in promise) DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided must not be empty.

Solution

Filter out empty strings when creating Classes

src/virtual_dom/mod.rs Outdated Show resolved Hide resolved
@jstarry
Copy link
Member Author

jstarry commented Dec 3, 2019

Needs tests

@jstarry jstarry merged commit fd8c3ee into yewstack:master Dec 4, 2019
@jstarry jstarry deleted the filter-empty-classes branch December 4, 2019 04:06
llebout pushed a commit to llebout/yew that referenced this pull request Jan 20, 2020
* Filter empty string classes

* cargo fmt

* feedback

* Add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants