Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Html/Events/Extra/Mouse.elm
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ Therefore they are available here with attribute `offsetPos`.
relativePos mouseEvent =
mouseEvent.offsetPos

The `movementX/Y` properties not being compatible with Safari / iOS,
they are not provided by this package.
The `movementX/Y` properties are not provided by this package,
since they are not supported by any mobile browser
(despite the fact that official docs say the opposite as of writing at Jun, 2023) –
and [Html.Events.Pointer][Pointer-Event] uses the same decoder.
The `x` and `y` properties being equivalent to `clientX/Y`,
are not provided either.
The `screenPos` attribute provides `screenX/Y` properties in case needed,
Expand All @@ -87,6 +89,7 @@ article [A tale of two viewports][tale-viewports].

[js-mouse-event]: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
[tale-viewports]: https://www.quirksmode.org/mobile/viewports.html
[Pointer-Event]: Html-Events-Extra-Pointer#Event

-}
type alias Event =
Expand Down
7 changes: 7 additions & 0 deletions src/Html/Events/Extra/Pointer.elm
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ And to know if the shift key was pressed:
isShiftKeyPressed event =
event.pointer.key.shift

Note about `movementX/Y`: official docs say that support for
[PointerEvent][PointerEventSupport] and [MouseEvent][MouseEventSupport]
is implemented by all modern (and not) browsers, but in fact `movementX/Y` properties
are not present on any of mobile browsers (as of writing).

[PointerEvent]: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
[MouseEvent]: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
[PointerEventSupport]: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#browser_compatibility
[MouseEventSupport]: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent#browser_compatibility
[Mouse-Event]: Html-Events-Extra-Mouse#Event

-}
Expand Down