Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information