-
-
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
Preserve ordering of classes #424
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @charvp! Sorry for the delay in the review, do you still have interest in getting this merged? I think we could change a few things, but think it's a good problem to solve for those using semantic ui!
I'm not using yew anymore since my project using it didn't pan out, but I'll take a look at rebasing this PR and incorporating your review over the weekend. |
I incorporated your comments into the pull request. However, to support the not equal assertion I had to make some changes to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much! Just one comment and then we're good to go. Really appreciate you jumping back on this :)
src/virtual_dom/vtag.rs
Outdated
@@ -546,7 +546,7 @@ impl<COMP: Component> PartialEq for VTag<COMP> { | |||
return false; | |||
} | |||
|
|||
if self.classes != other.classes { | |||
if self.classes.iter().collect::<Vec<&String>>() != other.classes.iter().collect::<Vec<&String>>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you can use this for inequality: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.ne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I tried a simple !=
but that didn't work. Fixed!
bors r+ |
Build succeeded |
This should fix #393.
I didn't add functionality that preserves uniqueness of classes, since
classList.add
will do that for us.