-
-
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
ordering of classes in html tags #393
Comments
This matter because of frameworks such as Semantic UI: Semantic-Org/Semantic-UI#5484 |
Found the reason: https://github.com/DenisKolodin/yew/blob/e6fc66e185c83bb9bb08a86750a57a3558bc9a18/src/virtual_dom/mod.rs#L42-L43 |
Ordered iterator: https://doc.rust-lang.org/std/collections/struct.BTreeSet.html#method.iter |
@hgzimmerman agreed, and going from HashSet to BTreeSet would preserve the Set API. |
I tried a quick test, just replacing all occurrences, the classes seem to be disordered still, but at least deterministic. |
It would be hard to implement the |
Oh, I'm dumb. The BTreeSet will order them, but in no relation to insertion order (alphabetical). It may make sense to wrap |
Description
bug report
Currently the order in which classes are added to the DOM in the browser do not reflect the same order in which they were added in the Renderable -> View function using the html! macro.
Expected Results
html!(<div class="three wide column",></div>)
should result in<div class="three wide column"></div>
in the DOM.Actual Results
html!(<div class="three wide column",></div>)
should result in<div class="wide column three"></div>
in the DOM.Context (Environment)
Rust: nightly-2018-08-24
yew: git/master e6fc66e
target: wasm32-unknown-unknown
cargo-web 0.6.15
firefox nightly
The text was updated successfully, but these errors were encountered: