From 2936f06576997bffe7903ea840df563a408efc21 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 9 Aug 2020 18:46:05 +0200 Subject: Improve autocompletion usage --- src/Lib/Dom/Element.ml | 3 +++ src/Lib/Dom/Event.ml | 3 +++ src/Lib/Dom/HE.ml | 2 ++ 3 files changed, 8 insertions(+) (limited to 'src/Lib/Dom') diff --git a/src/Lib/Dom/Element.ml b/src/Lib/Dom/Element.ml index e370cf5..feb6003 100644 --- a/src/Lib/Dom/Element.ml +++ b/src/Lib/Dom/Element.ml @@ -46,3 +46,6 @@ let mount_on base element = external files : Dom.element -> string Js.Array.t = "files" [@@bs.get] + +external focus : Dom.element -> unit = "focus" + [@@bs.send] diff --git a/src/Lib/Dom/Event.ml b/src/Lib/Dom/Event.ml index 9db46f0..5a9790f 100644 --- a/src/Lib/Dom/Event.ml +++ b/src/Lib/Dom/Event.ml @@ -7,6 +7,9 @@ external stop_propagation : Dom.event -> unit = "stopPropagation" external target : Dom.event -> Dom.element = "target" [@@bs.get] +external related_target : Dom.event -> Dom.element Js.Nullable.t = "relatedTarget" + [@@bs.get] + external page_x : Dom.mouseEvent -> float = "pageX" [@@bs.get] diff --git a/src/Lib/Dom/HE.ml b/src/Lib/Dom/HE.ml index 6e658ce..03d2386 100644 --- a/src/Lib/Dom/HE.ml +++ b/src/Lib/Dom/HE.ml @@ -9,3 +9,5 @@ let on_submit f = H.EventAttr ("submit", f) let on_blur f = H.EventAttr ("blur", f) let on_change f = H.EventAttr ("change", f) + +let on_focus f = H.EventAttr ("focus", f) -- cgit v1.2.3