Source file private_skyline_autofocus.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
open! Core
open! Bonsai_web

module Input = struct
  type t = unit [@@deriving sexp_of]

  let combine () () = ()
end

module State = Unit

let init () _ = ()

let on_mount =
  `Schedule_immediately_after_this_dom_patch_completes (fun () () elem -> elem##focus)
;;

let update ~old_input:() ~new_input:() () _ = ()
let destroy () () _ = ()

include functor Vdom.Attr.Hooks.Make

let focus_on_mount = Vdom.Attr.create_hook "skyline-focus-on-mount" (create ())