Skip to content

autocomplete on input (the only element affected?) renders when false is passed, but no other attribute does this? #21344

Open

Description

@NullVoxPopuli

🐞 Describe the Bug

<template>
  
  Theese all render the attribute - any string value, or truthy value renders the attribute.
  Here we defer to HTML for what behavior is. But strictly speaking of attribute rendering.
  <div aria-hidden="{{true}}"></div>
  <div aria-hidden={{true}}></div>
  <div aria-hidden={{""}}></div>
  <div aria-hidden></div>
  <div aria-hidden=""></div>
  <div aria-hidden="true"></div>
  <div aria-hidden="false"></div>

  These do not render the attribute
  <div aria-hidden={{false}}></div>
  <div aria-hidden={{null}}></div>
  <div aria-hidden={{undefined}}></div>

  autocomplete, specifically - behavior is different from above.
  attribute is rendered. 
  I would consider this a bug.
  <input autocomplete={{false}}>
  Attribute comes back, seems specific to autocomplete?
  <input hidden={{false}}>

</template>

https://limber.glimdown.com/edit?c=DwFwpgtgDgNghuAfAKAASragKgCzGAZzFThhlQCcwA7AEzAtRDxJBAoEsAjAV3FQC0JagE9UBdh2oBzVADdSPMABpUAe0bs%2BOMQphLKNehQJMWCSb3AA6TAAkGxAO7F6AMwZM1qO1gCyADKobhqoTjgIqFxgEXIcoRwE1qgAQnzikgDGIDBiBFBgcADWUrJqbqyWfMRUdAyltujAtBxyJJxwAjgctPTUALwARADew1pgAL4Tg4jAAPQtcihNi%2B0cnd29NP2j41OzC63LqM2taxs9fTvDg4P784vHp21wHV2XNAePmM-n71sDW5fI4-Vavdb-K6DcYzB4glZncEXAFDNykIiww5LZCYXCEVzeahqECGOqacxsThWMCgxFvTZXUZomBEe5Yp5g%2BkfAajag8Mhs74Il5clGjHh1NxSMC0QUgzBwPhqTJqaAwMDgVT5MCZDhSzKkXKCKIxOBxBKmFpuDy1EluCiqkhcNRyMCNSpU6qoRKk4wy5KYACSYTU-NoqBV1AIPU8zB9cCiPGk7uAUig6UVIGVqtgGrA12ZrImxwAgpTuF6VRBCFE4Jkilr8BBTNrdfqvCQlVXc%2BAAPw-NPpBnbJnoybFnHzcBqhBgRBAA&format=gjs

Ember 7.1 alpha.2

  • OS: -
  • Browser: -

➕ Additional Context

Add any other context about the problem here.

Activity

  1. johanrd commented on Apr 28, 2026

    @johanrd
    Contributor

    @NullVoxPopuli Tried now, autocomplete={{false}} rendering autocomplete="false" seems to share shares behavior with at least ~28 others:

    Plain strings: id, name, type, placeholder, alt, title, lang, role, target, rel, accept, dir, slot, method, enctype, action, src, href, download, Numerics on <input type="number">: min, max, step, Enumerateds: draggable, spellcheck, autocapitalize, Custom: part, popover

    The inverse — class, for, value, referrerpolicy, itemprop, itemtype diverts from that: The aria-hidden-style "omit on bare falsy" behavior is also a large group (~58 attrs: all HTML booleans, all ARIA, plus the six divertors above).

    Repro in limber here

    Some noteworthy behavior divergencies:

    1. "Plain string" attrs split: some omit, some render "false"

    <template>
      <input name={{false}} />                {{!-- → <input name="false"> --}}
      <input value={{false}} />               {{!-- → <input> --}}
    </template>

    2. Numeric attrs split three ways

    <template>
      <td colspan={{false}}>x</td>            {{!-- → <td>x</td>  (omitted) --}}
      <input type="number" min={{false}} />   {{!-- → <input min="false" type="number">  (literal) --}}
      <img width={{false}} alt="" />          {{!-- → <img width="0" alt="">  (coerced to 0) --}}
    </template>

    3. Enumerated attrs split three ways

    <template>
      <div draggable={{false}}></div>         {{!-- → <div draggable="false"></div>  (literal) --}}
      <div contenteditable={{false}}></div>   {{!-- → <div></div>  (omitted) --}}
      <div translate={{false}}></div>         {{!-- → <div translate="no"></div>  (mapped to spec keyword!) --}}
    </template>

    4. Paired API attributes split

    <template>
      <div popover={{false}}>x</div>                      {{!-- → <div popover="false">x</div>  (literal) --}}
      <button popovertarget={{false}}>x</button>          {{!-- → <button>x</button>  (omitted) --}}
    </template>

    5. contenteditable={{false}} ≠ contenteditable={{"false"}}

    <template>
      <div contenteditable={{false}}></div>   {{!-- → <div></div> --}}
      <div contenteditable={{"false"}}></div> {{!-- → <div contenteditable="false"></div> --}}
    </template>

    6. class={{false}} ≠ class="{{false}}"

    <template>
      <div class={{false}}></div>             {{!-- → <div></div> --}}
      <div class="{{false}}"></div>           {{!-- → <div class="false"></div> --}}
    </template>

    7. checked="{{false}}" ≠ disabled="{{false}}" — but only in concat form

    <template>
      <button disabled="{{false}}">x</button>           {{!-- → <button disabled="">x</button> --}}
      <input type="checkbox" checked="{{false}}" />    {{!-- → <input type="checkbox">  (no checked attr) --}}
    </template>

    8. Numeric-zero is falsy only for HTML boolean attrs

    <template>
      <button disabled={{0}}>x</button>       {{!-- → <button>x</button>  (omits) --}}
      <td colspan={{0}}>x</td>                {{!-- → <td colspan="0">x</td>  (renders) --}}
    </template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions