cyntler / hamburger-react

Animated hamburger menu icons for React.js weighs only 1.5 KB.
https://hamburger-react.netlify.app
MIT License
963 stars 36 forks source link

Highlight on mobile click #59

Open Garett-MacGowan opened 1 year ago

Garett-MacGowan commented 1 year ago

Version 2.5.0

Steps to Reproduce

When users interact with the menu on mobile devices, the burger is highlighted during the transition.

Reproduceable on the example site: https://hamburger-react.netlify.app/

Note

This may or may not be expected, but it would be nice to have the option to turn it off. I recognize most click events on mobile are associated with this behavior.

Workaround

My temporary (tested only on chrome) workaround using style jsx:

<div className='burger-container' onClick={props.onClick}>
    <Spiral size={28} label='menu' easing="ease-out" hideOutline={true}/>
</div>
<style jsx>{`
  .burger-container:first-child {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
`}</style>

webkit, moz, ms, and user-select statements taken from this stack overflow.

luukdv commented 1 year ago

Thanks for reporting.

I indeed decided not to turn this off by default since it's expected on click, but I agree it would be helpful to make it more easy to turn off.

In version 3.0 you will be able to simply forward style and className, for now this would be simplest:

.hamburger-react { -webkit-touch-callout: … }
fffan64 commented 1 year ago

hello, thanks for the pkg it's great

any eta for the v3 release ? thanks !

luukdv commented 1 year ago

No ETA yet! Working on it in the v3 branch whenever I can, but I've been short on time. I'll let you know when it's ready to test.

luukdv commented 1 year ago

Update about v3.0: Looking for new owner