diff --git a/packages/yew/src/dom_bundle/btag/attributes.rs b/packages/yew/src/dom_bundle/btag/attributes.rs index 2634a06b1dd..3aaf1723cb5 100644 --- a/packages/yew/src/dom_bundle/btag/attributes.rs +++ b/packages/yew/src/dom_bundle/btag/attributes.rs @@ -186,7 +186,7 @@ impl Attributes { ApplyAttributeAs::Property => { match key { // need to be attributes because, otherwise query selectors fail - "class" | "id" => el + "class" => el .remove_attribute(key) .expect("could not remove attribute"), _ => { @@ -357,9 +357,8 @@ mod tests { } #[test] - fn class_id_are_always_attrs() { + fn class_is_always_attrs() { let attrs = Attributes::Static(&[ - ("id", "foo", ApplyAttributeAs::Property), ("class", "thing", ApplyAttributeAs::Attribute), ]); diff --git a/packages/yew/src/virtual_dom/vtag.rs b/packages/yew/src/virtual_dom/vtag.rs index b9e849e3d91..f9621fe59c5 100644 --- a/packages/yew/src/virtual_dom/vtag.rs +++ b/packages/yew/src/virtual_dom/vtag.rs @@ -371,8 +371,8 @@ impl VTag { /// Adds a key-value pair to element's property /// - /// Not every property works when it set as an attribute. We use workarounds for: - /// `class` and `id`, which are both set as attributes. + /// Not everything works when it set as an property. We use workarounds for: + /// `class`, which is set as attribute. pub fn set_property(&mut self, key: &'static str, value: impl Into) { self.attributes.get_mut_index_map().insert( AttrValue::Static(key),