You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now there is no way to pass additional options to addEventListener method of eventTarget class. Js_of_ocaml only provides old-fashioned signature for addEventListener, where only useCapture flag can be passed. Here are the docs for options that can be passed to addEventListener. IMO, at least passive option should be also added to jsoo bindings (Dom, Dom_html, and Lwt_js_events modules).
Are there any reasons why this is still not a part of jsoo? Would you accept a PR if I implement this feature?
The text was updated successfully, but these errors were encountered:
I've noticed that a corresponding PR (#807) already exists.
However, it lacks updates for Lwt_js_events modules.
As @FacelessPanda mentions in his PR, options can be passed to addEventListener as a single object or as optional arguments. I think passing optional arguments is a better option, as we can check browser support for additional options like passive and once and ignore them if not supported.
As for the Lwt_js_events module, the once option seems redundant because event listener is added once again after every event occurrence, so we may need to add only passive and use_capture optional arguments to existing functions.
For now there is no way to pass additional options to
addEventListener
method ofeventTarget
class. Js_of_ocaml only provides old-fashioned signature foraddEventListener
, where onlyuseCapture
flag can be passed. Here are the docs for options that can be passed toaddEventListener
. IMO, at leastpassive
option should be also added to jsoo bindings (Dom
,Dom_html
, andLwt_js_events
modules).Are there any reasons why this is still not a part of jsoo? Would you accept a PR if I implement this feature?
The text was updated successfully, but these errors were encountered: