|
| 1 | +open Webapi.Dom; |
| 2 | + |
| 3 | +let handleSelection = (_) => print_endline("change"); |
| 4 | + |
| 5 | +let elm = document |> Document.createElement("strong"); |
| 6 | + |
| 7 | +Element.addSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "once": true, "capture": false}, elm); |
| 8 | +Element.addSelectionChangeEventListenerUseCapture(handleSelection, elm); |
| 9 | +Element.removeSelectionChangeEventListener(handleSelection, elm); |
| 10 | +Element.removeSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "capture": false}, elm); |
| 11 | +Element.removeSelectionChangeEventListenerUseCapture(handleSelection, elm); |
| 12 | + |
| 13 | +let htmlElm = document |> Document.createElement("strong") |> HtmlElement.ofElement |> TestHelpers.unsafelyUnwrapOption; |
| 14 | + |
| 15 | +HtmlElement.addSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "once": true, "capture": false}, htmlElm); |
| 16 | +HtmlElement.addSelectionChangeEventListenerUseCapture(handleSelection, htmlElm); |
| 17 | +HtmlElement.removeSelectionChangeEventListener(handleSelection, htmlElm); |
| 18 | +HtmlElement.removeSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "capture": false}, htmlElm); |
| 19 | +HtmlElement.removeSelectionChangeEventListenerUseCapture(handleSelection, htmlElm); |
| 20 | + |
| 21 | +let htmlDoc = document |> Document.asHtmlDocument |> TestHelpers.unsafelyUnwrapOption; |
| 22 | + |
| 23 | +HtmlDocument.addSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "once": true, "capture": false}, htmlDoc); |
| 24 | +HtmlDocument.addSelectionChangeEventListenerUseCapture(handleSelection, htmlDoc); |
| 25 | +HtmlDocument.removeSelectionChangeEventListener(handleSelection, htmlDoc); |
| 26 | +HtmlDocument.removeSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "capture": false}, htmlDoc); |
| 27 | +HtmlDocument.removeSelectionChangeEventListenerUseCapture(handleSelection, htmlDoc); |
| 28 | + |
| 29 | +Window.addSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "once": true, "capture": false}, window); |
| 30 | +Window.addSelectionChangeEventListenerUseCapture(handleSelection, window); |
| 31 | +Window.removeSelectionChangeEventListener(handleSelection, window); |
| 32 | +Window.removeSelectionChangeEventListenerWithOptions(handleSelection, {"passive": true, "capture": false}, window); |
| 33 | +Window.removeSelectionChangeEventListenerUseCapture(handleSelection, window); |
0 commit comments