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

HasStyle.addClassNames() doesn't handle multiple whitespaces #11709

Closed
mvysny opened this issue Sep 1, 2021 · 4 comments · Fixed by #11861
Closed

HasStyle.addClassNames() doesn't handle multiple whitespaces #11709

mvysny opened this issue Sep 1, 2021 · 4 comments · Fixed by #11861

Comments

@mvysny
Copy link
Member

mvysny commented Sep 1, 2021

Description of the bug / feature

new Div().addClassNames("   foo  bar    baz")

fails with

java.lang.IllegalArgumentException: Class name cannot be empty
	at com.vaadin.flow.internal.nodefeature.ElementClassList$ClassListView.validate(ElementClassList.java:45)
	at com.vaadin.flow.internal.nodefeature.ElementClassList$ClassListView.validate(ElementClassList.java:31)
	at com.vaadin.flow.internal.nodefeature.NodeList$SetView.add(NodeList.java:113)
	at com.vaadin.flow.internal.nodefeature.NodeList$SetView.add(NodeList.java:86)
	at com.vaadin.flow.component.HasStyle.addClassNames(HasStyle.java:144)

Expected behavior

The div should have three class names added.

Actual behavior

The code fails with an exception

Versions:

- Vaadin / Flow version: 14.6.8
- Java version: 8
@mshabarov mshabarov self-assigned this Sep 1, 2021
@mshabarov mshabarov added this to Needs triage in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) via automation Sep 1, 2021
@mshabarov mshabarov moved this from Needs triage to New P2 in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Sep 1, 2021
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from WIP to Closed Sep 17, 2021
vaadin-bot added a commit that referenced this issue Sep 17, 2021
Fixes #11709

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this issue Sep 17, 2021
Fixes #11709

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this issue Sep 17, 2021
Fixes #11709

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 22.0.0.alpha4 and is also targeting the upcoming stable 22.0.0 version.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 21.0.2.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 14.7.1.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 20.0.8.

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