Skip to content

ToggleSwitch button type="submit" #5823

@kurpav

Description

@kurpav

Description

ToggleSwitch component is based on button tag, but it has no type attribute, so by default it has type="submit". This causes issues when the component is used inside form tag.

Steps to reproduce

  1. Add ToggleSwitch component in form tag.
  2. Make it controllable, add checked and onChange attributes.
  3. Check how many times onChange callback is called on init.
  4. Try to switch toggle

Version

36.27.0

Browser

Chrome

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