Skip to content

Vdom diff fail to detect disabled property change #49

@tonyfettes

Description

@tonyfettes

I was adding disabled property to the button view:

///|
pub fn button[M](
  disabled? : Bool,
  style~ : Array[String] = [],
  id? : String,
  class? : String,
  click? : M,
  childrens : Array[Html[M]]
) -> Html[M] {
  let attrs = []
  if click is Some(click) {
    attrs.push(on_click(fn(_) { click }))
  }
  if disabled is Some(true) {
    attrs.push(property("disabled", Boolean(true)))
  }
  common_node(style~, class?, id?, "button", attrs, childrens)
}

And it fails to update the button from disabled=true to disabled=false.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions