equinor / design-system

The Equinor design system
MIT License
121 stars 64 forks source link

fix: when using menu in a form, the form is submitted #3660

Closed FredrikMWold closed 1 month ago

FredrikMWold commented 1 month ago

When using Menu in a form, the form is submitted when clicking on a menu item if closeMenuOnClcik is set to false

The problem is a missing type="button". Looks like this bug has been hiding behind the fact that having it in a form and having closeMenuOnClick set to false is rare. The onClick callback being called twice when you set closeMenuOnClick set to false and dont give a onClose callback seems to have some have resolved for that instance