Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set read-only class if readonly is null #276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on May 27, 2021

  1. Add failing tests

    cincodenada committed May 27, 2021
    Configuration menu
    Copy the full SHA
    1919593 View commit details
    Browse the repository at this point in the history
  2. 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.
    cincodenada committed May 27, 2021
    Configuration menu
    Copy the full SHA
    18244ed View commit details
    Browse the repository at this point in the history