I want to set form fields to readonly, based on a condition I defined in fusion and this is the best I came up with…
<input @if.readonly={props.readonly} readonly name={props.fieldName} type="text" />
<input @if.writeable={!props.readonly} name={props.fieldName} type="text" />
Is there a more elegant way, without code duplication to set or not set an attribute in a tag? The problem with readonly is, it does not work and is not valid to set it to false…