Dom.preventDefault hack keeps browser shortcuts from happening.

This commit is contained in:
cqc
2023-02-17 15:25:04 -06:00
parent 480e77bbb9
commit 7a1e4ef2ba
2 changed files with 2 additions and 1 deletions

View File

@ -118,5 +118,6 @@ let _ =
images); images);
buffered_loop (make_event Dom_html.Event.keydown) Dom_html.document buffered_loop (make_event Dom_html.Event.keydown) Dom_html.document
(fun ev _ -> (fun ev _ ->
Dom.preventDefault ev;
Lwt.return Lwt.return
@@ push_event (Some (`Keys [ Event_js.evt_of_jskey ev ]))) @@ push_event (Some (`Keys [ Event_js.evt_of_jskey ev ])))

View File

@ -3163,7 +3163,7 @@ module Widgets = struct
else `Unhandled)) else `Unhandled))
| [ (`Uchar u, [ `Ctrl ]) ] when eq_uc_c u 'k' -> | [ (`Uchar u, [ `Ctrl ]) ] when eq_uc_c u 'k' ->
`Handled `Handled
| [ (`Uchar u, [ `Ctrl ]) ] when eq_uc_c u 'x' -> | [ (`Uchar s, [ `Ctrl ]) ] when eq_uc_c s 's' ->
let b = Buffer.create 1024 in let b = Buffer.create 1024 in
Lwd_table.iter Lwd_table.iter
(fun line -> (fun line ->