negomi / react-burger-menu

:hamburger: An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
http://negomi.github.io/react-burger-menu/
MIT License
5.07k stars 583 forks source link

Menu inside Formik #465

Closed Barna001 closed 2 years ago

Barna001 commented 2 years ago

<button id="react-burger-menu-btn" style="position: absolute; left: 0px; top: 0px; z-index: 1; width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; font-size: 0px; background: transparent; cursor: pointer;">Open Menu</button>

Nor the burger menu or the 'x' closing the menu has type="button" on it, so most browsers handle this as type="submit", which can cause false submits for example when you have a menu inside Formik or other form libs.

negomi commented 2 years ago

Hi @Barna001, oh interesting, I had not heard of someone using the menu inside Formik before :)

I have just pushed a fix which adds type="button" to each button inside the menu, so hopefully this should fix your issue.