Boolean block attribute with source «attribute» should allow «true»/«false» values #13949
Labels
[Feature] Block API
API that allows to express the block paradigm.
Needs Decision
Needs a decision to be actionable or relevant
[Type] Enhancement
A suggestion for improvement.
So I created a block with an attribute that looks like this:
and I'm trying to save this value as follows:
The problem is: it doesn't matter what the actual value of
data-show-zoom-button
is, Gutenberg always expects it to be set totrue
. Why? Is it because it's assuming that a non-empty HTML attribute value like"false"
should be translated totrue
?One possible solution could be: if
data-show-zoom-button
isfalse
, then don't include that attribute in the save method. But then a different problem would arise: I want to know the attribute isfalse
and I want to use that attribute; otherwise, Gutenberg would pull thedefault
value (which, in this case, is set totrue
).Any ideas on how to overcome this issue?
The text was updated successfully, but these errors were encountered: