-
Notifications
You must be signed in to change notification settings - Fork 195
[draft] Implement the popover
API.
#1734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
method showPopover : unit meth | ||
|
||
method showPopover_options : _ -> unit meth | ||
|
||
method togglePopover : bool t meth | ||
|
||
method togglePopover_force : bool t -> bool t meth | ||
|
||
method togglePopover_options : _ -> bool t meth | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the specs, these methods accept a dictionary as a parameter for passing options. How would that be reflected in Js_of_ocaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is an example in lib/js_of_ocaml/eventSource.ml
method onbeforetoggle : ('self t, toggleEvent t) event_listener writeonly_prop | ||
|
||
method ontoggle : ('self t, toggleEvent t) event_listener writeonly_prop | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are similar methods related to event handlers in this file that have the prop
type instead of writeonly_prop
. In fact, the ontoggle
method initially used the former type. Is this new version correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeonly_prop is often used for situation where the property might be undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
Files not reviewed (2)
- lib/js_of_ocaml/dom_html.ml: Language not supported
- lib/js_of_ocaml/dom_html.mli: Language not supported
I apologies for the extra long delay reviewing your PR. |
|
||
method popovertarget : element t opt prop | ||
|
||
method popovertargetaction : js_string t prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be popoverTargetAction
?
@@ -1284,6 +1308,10 @@ class type buttonElement = object | |||
method _type : js_string t readonly_prop | |||
|
|||
method value : js_string t prop | |||
|
|||
method popovertarget : element t opt prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be popoverTargetElement
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First batch of review.
Maybe we should have a small demo in examples/ so that we can tests such feature.
Hello,
This PR adds support for the
popover
API.See:
Please let me know of any issue; in fact, I would appreciate your input regarding a couple things (see below).
Cheers,