Subscribe on changes!

Why is there only aria-autocomplete on button? why no autocomplete?

avatar
Sep 20th 2021

Version

3.2.12

Reproduction link

developer.mozilla.org

Steps to reproduce

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button

Make button component

<button
        autofocus
        aria-autocomplete=""
        disabled="false"
        form=""
        formaction=""
        formenctype=""
        formmethod=""
        formnovalidate
        name=""
        type=""
        value=""
        >
  Vue Button attributes demo
</button>

What is expected?

Why is there no autocomplete attribute on vue? It's standard html, and other frameworks such as React supports it.

What is actually happening?

autocomplete attribute is not present

avatar
Sep 20th 2021

Why is there no autocomplete attribute on vue? It's standard html [...]

From the MDN page you linked to:

This attribute on a <button> is nonstandard and Firefox-specific.

Also I'd like to verify: you have an issue with this attribute being missing from the types here?

https://github.com/vuejs/vue-next/blob/e9c0694451ba15b53fc3e8c81940db627e9da9b2/packages/runtime-dom/types/jsx.d.ts#L344-L356

avatar
Sep 21st 2021

Does the bug described on the MDN page affect Javascript frameworks?

avatar
Sep 21st 2021

What bug?

avatar
Sep 22nd 2021

There is no bug here - autocomplete on button is not valid, so it's not supported in the JSX typing. Despite typing, you still can render an autocomplete attribute on a button if you want, so I don't know what is expected here.