Skip to content

Commit

Permalink
Added cancel and close events
Browse files Browse the repository at this point in the history
  • Loading branch information
sagotch authored and hhugo committed Feb 29, 2024
1 parent 005e668 commit 6a69eb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/js_of_ocaml/dom_html.ml
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,12 @@ let invoke_handler = Dom.invoke_handler
module Event = struct
type 'a typ = 'a Dom.Event.typ

let cancel = Dom.Event.make "cancel"

let click = Dom.Event.make "click"

let close = Dom.Event.make "close"

let copy = Dom.Event.make "copy"

let cut = Dom.Event.make "cut"
Expand Down Expand Up @@ -1304,6 +1308,10 @@ class type dialogElement =
method show : unit meth

method showModal : unit meth

method oncancel : ('self t, event t) event_listener prop

method onclose : ('self t, event t) event_listener prop
end

class type divElement = element
Expand Down
8 changes: 8 additions & 0 deletions lib/js_of_ocaml/dom_html.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,10 @@ class type dialogElement =
method show : unit meth

method showModal : unit meth

method oncancel : ('self t, event t) event_listener prop

method onclose : ('self t, event t) event_listener prop
end

class type divElement = element
Expand Down Expand Up @@ -2314,8 +2318,12 @@ val eventRelatedTarget : #mouseEvent t -> element t opt
module Event : sig
type 'a typ = 'a Dom.Event.typ

val cancel : event t typ

val click : mouseEvent t typ

val close : event t typ

val copy : clipboardEvent t typ

val cut : clipboardEvent t typ
Expand Down

0 comments on commit 6a69eb6

Please sign in to comment.