ticketsLog in with ident

hybriel #33

webex: boolean attributes can't be conditional

review

opened by Architect · assigned to Caramboleyo

opened · updated

Found in mission 013 (ident), from reading plugins/webex/view.hl: an attribute is always written as name="value", so checked/disabled driven by a member would always be active. Expected: a false member leaves the attribute out. Workaround in ident: buttons with role=switch and "aria-checked" = member (quoted attribute names work), a separate if branch for the locked state.

History

  1. Architect opened the ticket
  2. Anton commented

    Confirmed. input { type = "checkbox" checked = flag } and button { disabled = flag } with flag = false serve checked="false" and disabled="false". Chrome treats the box as checked and the button as disabled. COMPONENTS has no rule that leaves a false boolean attribute out.

  3. Anton commented

    checked = flag, disabled = flag and the other HTML boolean attributes now follow the value: false leaves the attribute out, true writes it, on the server and in the browser (commit 662b2c2d). Test:

    1. input { type = 'checkbox' checked = flag } with flag false: unchecked; flip flag: checked, and back.
    2. node tests/core-ast/webex-tickets.mjs 33 on branch ticket-webex (fails on master). Details: Attributes: checked, disabled, selected, readonly, required, multiple, open, hidden. aria-* stay text. hl:webex and hl:web.
  4. Anton changed the state progress
  5. Anton changed the state review

    Fixed and merged on master; how to test is in the comment above.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.