Closed Ebmtranceboy closed 1 year ago
I tihnk this is correct. Have you tried with OnClick
? That should work on both.
Indeed, OnClick
works on both.
When you say 'correct', do you mean my observations are the expected behavior ?
Sorry, late to the party here.
I can add a unit test.
Does anyone know if jsdom
can simulate touch events?
I can't say but, from this SO thread, a generic solution working for desktop, Android and MicroSoft (should I mention Apple ?)'s phones would be witchcraft :(
@mikesol this attribute name (and related ones) still have spaces in it, you need to trim it during codegen: https://github.com/mikesol/purescript-deku/blob/778a6ee1883bd353c9f51cbc27aa2ccfc1838dde/src/Deku/DOM/Attr/OnTouchstart.purs#L12
Fixed! https://github.com/mikesol/purescript-deku/releases/tag/v0.9.24 Thanks to @Ebmtranceboy for reporting and thanks to @MonoidMusician for spotting the bug!
Hi, I have this silly code (changing the button text according to clicks) working well with
D.OnMousedown
but not withD.OnTouchstart
on my Android phone, either Chrome or Samsung Internet.I compared both js bundles (very similar as expected) so I can't figure out where is the trouble since I have no problem when using touch events with the
Web.HTML.*
andWeb.DOM.*
libraries when I do (painfully)addEventListener (EventType "touchstart") start true (toEventTarget element)