Commit 80e04d4
committed
Don't set read-only class if readonly is null
toggleClass() requires a boolean value, not just a truthy/falsy one.
When readonly is null, the current code results in the read-only class
being toggled (since null is treated the same as the argument not being
provided), resutling in indeterminate results depending on what the
previous value of readonly was.
To avoid this surprising behavior, just coerce the value of readonly to
a boolean before passing it to toggleClass(), so that null will always
result in no read-only class, same as if the readonly attribute was not
provided.1 parent 90b4cbe commit 80e04d4
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
0 commit comments