From f8f506f1d8401d7a621445701b2e41be7a5fcec5 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Date: Mon, 8 Aug 2022 23:33:38 +0500 Subject: [PATCH] id as property --- packages/yew/src/dom_bundle/btag/attributes.rs | 2 +- packages/yew/src/virtual_dom/vtag.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/yew/src/dom_bundle/btag/attributes.rs b/packages/yew/src/dom_bundle/btag/attributes.rs index 2634a06b1dd..12942b67bfb 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"), _ => { 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),