Skip to content

SVG inside of button will cause js error #15

@rpb138

Description

@rpb138

I'm trying to put a hamburger icon inside of the button that controls the open of the slide-menu, clicking on the icon causes the following js error.

slide-menu.ie.js:1060 Uncaught TypeError: e.className.includes is not a function
at HTMLDocument. (slide-menu.ie.js:1060)
(anonymous) @ slide-menu.ie.js:1060

Button HTML:
<button id="navMobBtn" class="mobile-menu__button--open slide-menu__control" type="button" data-target="mobile-nav-menu" data-action="open" aria-controls="mobile-nav-menu" aria-expanded="false" aria-label="Toggle navigation"> <span class="slide-menu__control hamburger-icon"></span> </button>

CSS:
.hamburger-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5); height: 2.5rem; width: 2.5rem; }

EDIT: This also happens when you just wrap a HTML element around the button text.
<span class="myClass">Open Menu</span>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions