Chameleon 6.25.0 (2025-10-15)
Category | Change |
---|---|
[ch-popover] Fix issues related with the positioning of the popover by @ncamera in #562 |
Improvements in the ch-popover
component
-
Use the viewport size, instead of the whole document size to properly position the popover.
When the document has scrollbars, thech-popover
was not positioned correctly because the entire document size was used instead of the viewport size. -
Properly calculate the
ch-popover
's max size.
We were always using the max size of the CSS custom vars if they were defined. -
Add support to re-position the
ch-popover
when the browser's window is resized. -
Add support to close the popover if it is no longer visible.
-
Add support to know the reason of the
popoverClosed
event.
Thereason
property of the event provides more information about the cause of the closing:-
"click-outside"
: The popover is being closed because the user clicked outside the popover when usingcloseOnClickOutside === true
andmode === "manual"
. -
"escape-key"
: The popover is being closed because the user pressed the "Escape" key when usingcloseOnClickOutside === true
andmode === "manual"
. -
"popover-no-longer-visible"
: The popover is being closed because it is no longer visible. -
"toggle"
: The popover is being closed by the native toggle behavior of popover. It can be produced by the user clicking theactionElement
, pressing the "Enter" or "Space" keys on theactionElement
, pressing the "Escape" key or other. Used whenmode === "auto"
.
-
-
Avoid emitting duplicated
popoverClosed
event.
This fixes emitting the duplicated event in the following scenarios:-
The "Escape" key is pressed in
mode === "manual"
. -
The user clicks outside the popover in
mode === "manual"
. -
The
show
property is changed tofalse
externally. -
The user scrolls the window and the popover is no longer visible.
-
Full Changelog: v6.24.0...v6.25.0