-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can not use spaces in class names when using List/Vec #935
Comments
@LiquidBlock by non-unique class names do you mean that class names can be repeated? |
Yes |
I'm in favour of non-unique class names if it's needed for using Semantic-UI. So in that case, we could probably just change this issue to reflect supporting that feature. Thoughts? |
Semantic-UI has an closed issue, where they discussed the usage of repeating class names: Semantic-Org/Semantic-UI#1526
There are some arguments about the HTML5 spec:
As far as i am aware of, this is the reason, that https://github.com/meteor/blaze does not support repeating class names, but there is a library for meteor supporting Semantic-UI: https://github.com/Semantic-Org/Semantic-UI-Meteor Below are some current quotes from the spec: https://html.spec.whatwg.org/multipage/dom.html#classes
Which itself links to https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#set-of-space-separated-tokens:
Some things i noticed:
The Regardless of the spec requiring unique names or not, i would like to suggest at least the optional usage of repeated class names. |
@ADustyOldMuffin you could try this issue as well. It requires less knowledge of how Yew works internally |
I'll be honest, I did not understand the outcome of the comments about the using multiple class names. The implementation proposed in #1084 continues using the |
@bryanjswift that's fine, this issue was about spaces in class names. We can create a new issue for non-unique classnames if it's really needed |
Problem
When using a List (a tuple within the
html!
macro) or aVec
of classes and one item contains spaces e.g."hello hello world"
.vtag.classes.contains("world")
will return false.Steps To Reproduce
Expected behavior
I expected unique class names:
"hello world"
or the support of non-unique class names when specifying the classes as string.Screenshots
master (as of commit 1ede167)
Version 0.11.0
(Note that
Example
is not rendered)Environment:
stdweb
/web-sys
version [e.g. web-sys v0.3.33]Questionnaire
Suggestions
I have a solution in mind for both of my expected behaviors, but i am not sure if either of them is a desired one.
Should i open another issue to suggest some kind of feature to support non-unique class names?
Non-unique class names can be desired if e.g. Semantic UI is used, which is also one reason why the ordering of classes is supported in yew: #393.
I suggest to also add documentation for the expected behavior to
yew/src/virtual_dom/mod.rs
Line 59 in 1ede167
yew/src/virtual_dom/vtag.rs
Line 125 in 1ede167
The text was updated successfully, but these errors were encountered: