Skip to content

autofocus attr not included in button element when rendered #11851

@phallguy

Description

@phallguy

Do you want to request a feature or report a bug?

bug

What is the current behavior?

autoFocus prop on <button /> component is not rendered to the DOM. According to MDN autofocus is a valid attr for the button element.

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

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).

https://jsfiddle.net/pnkso56k/1/

What is the expected behavior?

autofocus attr should be rendered to DOM when provided as a prop to button component.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

React 16.2 in Chrome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions