Skip to content

Commit f37173f

Browse files
dkirchhofnojaf
andauthored
add popover attributes (#7317)
* add popover attributes to jsxdom props * use popover type Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com> * add popoverTargetAction docs Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com> * add popover docs Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com> * Update test * Add changelog entry --------- Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
1 parent 313f16f commit f37173f

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
1313
# 12.0.0-alpha.10 (Unreleased)
1414

15+
#### :rocket: New Feature
16+
17+
- Add popover attributes to JsxDOM.domProps. https://github.com/rescript-lang/rescript/pull/7317
18+
1519
#### :house: Internal
1620

1721
- Clean up legacy tags handling. https://github.com/rescript-lang/rescript/pull/7309

runtime/JsxDOM.res

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424

2525
type style = JsxDOMStyle.t
2626
type domRef
27+
/**
28+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover)
29+
*/
30+
type popover = | @as("auto") Auto | @as("manual") Manual | @as("hint") Hint
31+
/**
32+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#popovertargetaction)
33+
*/
34+
type popoverTargetAction = | @as("toggle") Toggle | @as("show") Show | @as("hide") Hide
2735

2836
/*
2937
This list isn't exhaustive. We'll add more as we go.
@@ -146,6 +154,9 @@ type domProps = {
146154
hidden?: bool,
147155
id?: string,
148156
lang?: string,
157+
popover?: popover,
158+
popoverTarget?: string,
159+
popoverTargetAction?: popoverTargetAction,
149160
role?: string /* ARIA role */,
150161
style?: style,
151162
spellCheck?: bool,

0 commit comments

Comments
 (0)