Enable/disable a button in Phoenix 1.7 depending on state

So I understand you advocate I should change to:

  attr :type, :string, default: nil
  attr :class, :string, default: nil
  attr :disabled, boolean, default: false
  attr :rest, :global, include: ~w(form name value)

  slot :inner_block, required: true

correct?

So, in Phoenix LV, if the value is false the attribute disabled is removed from the node, while if it is any other thing, the node gets the attribute as disabled="something else", which means that because disabled is still present, irrespective of value, it is considered as a disabled button.

I didn’t know about this. So this is yet another thing I learned :smiley: