-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Support for touch events (#102)
- Loading branch information
Showing
3 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
shared/src/main/scala/com/raquo/domtypes/defs/eventProps/TouchEventPropDefs.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.raquo.domtypes.defs.eventProps | ||
|
||
import com.raquo.domtypes.common.EventPropDef | ||
|
||
/** Touch events: triggered by a finger or stylus on a touch surface */ | ||
object TouchEventPropDefs { | ||
val defs: List[EventPropDef] = List( | ||
|
||
EventPropDef( | ||
scalaName = "onTouchStart", | ||
domName = "touchstart", | ||
scalaJsEventType = "dom.TouchEvent", | ||
javascriptEventType = "TouchEvent", | ||
commentLines = List( | ||
"The touchstart event is fired when one or more touch points are", | ||
"placed on the touch surface." | ||
), | ||
docUrls = List( | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Element/touchstart_event", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#browser_compatibility", | ||
), | ||
), | ||
|
||
EventPropDef( | ||
scalaName = "onTouchMove", | ||
domName = "touchmove", | ||
scalaJsEventType = "dom.TouchEvent", | ||
javascriptEventType = "TouchEvent", | ||
commentLines = List( | ||
"The touchmove event is fired when one or more touch points are moved", | ||
"along the touch surface.", | ||
), | ||
docUrls = List( | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Element/touchmove_event", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#browser_compatibility", | ||
), | ||
), | ||
|
||
EventPropDef( | ||
scalaName = "onTouchCancel", | ||
domName = "touchcancel", | ||
scalaJsEventType = "dom.TouchEvent", | ||
javascriptEventType = "TouchEvent", | ||
commentLines = List( | ||
"The touchcancel event is fired when one or more touch points have", | ||
"been disrupted in an implementation-specific manner.", | ||
), | ||
docUrls = List( | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Element/touchcancel_event", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#browser_compatibility", | ||
), | ||
), | ||
|
||
EventPropDef( | ||
scalaName = "onTouchEnd", | ||
domName = "touchend", | ||
scalaJsEventType = "dom.TouchEvent", | ||
javascriptEventType = "TouchEvent", | ||
commentLines = List( | ||
"The touchend event fires when one or more touch points are removed", | ||
"from the touch surface. Remember that it is possible to get a", | ||
"touchcancel event instead.", | ||
), | ||
docUrls = List( | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Element/touchend_event", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent", | ||
"https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#browser_compatibility", | ||
), | ||
), | ||
) | ||
} |