Skip to content
Discussion options

You must be logged in to vote

Hey there, 👋🏻

Since Mavo is already aware of some boolean attributes (like hidden; disabled on form elements; autoplay, buffered, and loop on <audio> and <video>, etc.), any expression that is resolved to true will add this attribute. If the expression is resolved to false, the attribute will be removed by Mavo automatically.

That's why something like this works out of the box:

<button disabled="[5 > 3]">Disabled</button>
<button disabled="[5 > 10]">Enabled</button>

However, to make other attributes boolean, we need an extra step — we must tell Mavo that they are boolean, i.e., we need to register those attributes. Mavo API is for the rescue (sorry, I don't know another way to do it witho…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@WebMechanic
Comment options

Answer selected by WebMechanic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants