react-selectable icon indicating copy to clipboard operation
react-selectable copied to clipboard

Added support for touch-based (mobile) events.

Open leopoldjoy opened this issue 9 years ago • 11 comments

leopoldjoy avatar Feb 16 '16 04:02 leopoldjoy

@unclecheese Note, I added a note at the bottom of README.md linking to my extended-features fork. Please let me know if you would prefer for me to remove this.

leopoldjoy avatar Feb 16 '16 08:02 leopoldjoy

@unclecheese Please let me know if you would like any additional changes made to the touch-device functionality.

leopoldjoy avatar Feb 16 '16 20:02 leopoldjoy

@unclecheese Thanks for the feedback! I made the syntactic changes and moved the mouse event tracking booleans out of the state.

In regards to your question of why we need to track the events: some devices are both click and touch enabled. On such devices the event handlers could fire twice. For example:

ReactDOM.findDOMNode(this).addEventListener('mousedown', this._mouseDown);
ReactDOM.findDOMNode(this).addEventListener('touchstart', this._mouseDown);

Additionally, for the mousemove/touchmove handlers, they could be doubly firing. Due to these inconsistencies of which events fire or are supported across platforms, I thought it best to guarantee that the functions are always fired in the correct order and not duplicated. What are your thoughts on this? I am open to altering this if you feel differently about it.

leopoldjoy avatar Feb 17 '16 20:02 leopoldjoy

Sorry, I had forgot to rebuild the bundle. Committed that now. I'm now working on updating the gh-pages branch so that the example has the new touch functionality. I will push shortly.

leopoldjoy avatar Feb 17 '16 21:02 leopoldjoy

Ok, everything is cleaned up and the gh-pages branch is rebundled. Please let me know if you feel that any other changes should be made.

leopoldjoy avatar Feb 17 '16 22:02 leopoldjoy

@unclecheese Please let me know if there are any additional changes you feel should be made.

leopoldjoy avatar Feb 18 '16 22:02 leopoldjoy

Thanks! I'll have a look at it in the next few days.

unclecheese avatar Feb 18 '16 22:02 unclecheese

@unclecheese Did you get a chance to look through the changes? Let me know if you feel any changes should be made.

leopoldjoy avatar Feb 25 '16 18:02 leopoldjoy

@unclecheese Any update on this? Love the library, but mobile users are out of luck without this.

aldahick avatar Jun 04 '18 18:06 aldahick

Any Update on this for mobile touch ?

shubham-2710 avatar Oct 30 '18 07:10 shubham-2710

Can we please mobile support with this?

danielmockaitis avatar Dec 15 '18 05:12 danielmockaitis