aboutsummaryrefslogtreecommitdiff
path: root/src/Lib
diff options
context:
space:
mode:
authorJoris2020-08-09 18:46:05 +0200
committerJoris2020-08-09 18:46:05 +0200
commit2936f06576997bffe7903ea840df563a408efc21 (patch)
tree0fd9c802c73df3e506ac0f65cdd2f48ba3de6a60 /src/Lib
parent225068497c5fd41da12030a6bbf58a0fc9c294d0 (diff)
Improve autocompletion usage
Diffstat (limited to 'src/Lib')
-rw-r--r--src/Lib/Dom/Element.ml3
-rw-r--r--src/Lib/Dom/Event.ml3
-rw-r--r--src/Lib/Dom/HE.ml2
3 files changed, 8 insertions, 0 deletions
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)