Skip to content

Commit 46c4836

Browse files
committed
Move some contents to a caution admonition
1 parent 3e867a9 commit 46c4836

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/LiveComponent/doc/index.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ a class:
929929
<div data-loading="removeClass(opacity-50)">...</div>
930930

931931
<!-- add multiple classes when loading -->
932-
<div data-loading="addClass(opacity-50 disabled)">...</div>
932+
<div data-loading="addClass(opacity-50 text-muted)">...</div>
933933

934934
Sometimes you may want to add or remove an HTML attribute when loading. That
935935
can be accomplished with ``addAttribute`` or ``removeAttribute``:
@@ -939,8 +939,11 @@ can be accomplished with ``addAttribute`` or ``removeAttribute``:
939939
<!-- add the "disabled" attribute when loading -->
940940
<div data-loading="addAttribute(disabled)">...</div>
941941

942-
<!-- add an attribute and its value -->
943-
<div data-loading="addAttribute(style='color: red')">...</div>
942+
.. caution::
943+
944+
The ``addAttribute()`` and ``removeAttribute()`` functions only work with
945+
empty HTML attributes (``disabled``, ``readonly``, ``required``, etc.) and
946+
not with attributes that define their values (e.g. this won't work: ``addAttribute(style='color: red')``).
944947

945948
You can also combine any number of directives by separating them with a
946949
space:

0 commit comments

Comments
 (0)