JedWatson / react-hammerjs

ReactJS / HammerJS integration. Support touch events in your React app.
MIT License
937 stars 129 forks source link

How to get rid of user-select: none? #88

Open wzup opened 6 years ago

wzup commented 6 years ago

Your plugin disables selection on a page. It voluntary sets style="user-select: none". How to disable it? I need to select elements

<Hammer onSwipe={this.handleSwipe} options={{defaults: {cssProps: { userSelect: true }} }} >
<Hammer onSwipe={this.handleSwipe} options={{cssProps: { userSelect: true } }} >
<Hammer onSwipe={this.handleSwipe} options={{defaults: { behavior: {cssProps: { userSelect: true }} }}} >

https://stackoverflow.com/questions/48418160/how-to-get-rid-of-user-select-none-in-react-hammer-js

petertenhoor commented 6 years ago

There was no way to fix this using the options prop. I ended up quickfixing it by adding a CSS class to the Hammer component and overwriting the hammer CSS:

.hammerContainer { user-select: all !important; }