Skip to content

Commit

Permalink
id as property
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza1311 committed Aug 8, 2022
1 parent 66e714c commit f8f506f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/yew/src/dom_bundle/btag/attributes.rs
Expand Up @@ -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"),
_ => {
Expand Down
4 changes: 2 additions & 2 deletions packages/yew/src/virtual_dom/vtag.rs
Expand Up @@ -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<AttrValue>) {
self.attributes.get_mut_index_map().insert(
AttrValue::Static(key),
Expand Down

0 comments on commit f8f506f

Please sign in to comment.