Skip to content

Require type attribute on button elements #4781

@AndreaBarbasso

Description

@AndreaBarbasso

Is your feature request related to a problem? Please describe.

We have some components that include buttons without an explicit type attribute (e.g. ds-entity-dropdown). This can cause issues when such components are included in a <form>, since the default type for a button is - counterintuitively - submit, and not button.

Describe the solution you'd like

I think the best approach to overcome this potential issue is to include a linting rule (e.g. https://html-eslint.org/docs/rules/require-button-type) to require an explicit button type.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🙋 Needs Help / Unscheduled

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions