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
Copy file name to clipboardExpand all lines: packages/overlay/README.md
+10-28Lines changed: 10 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,7 +269,7 @@ Some Overlays will always be passed focus (e.g. modal or page Overlays). When th
269
269
270
270
The `trigger` option accepts an `HTMLElement` or a `VirtualTrigger` from which to position the Overlay.
271
271
272
-
- You can import the `VirtualTrigger` class from the overlay package to create a virtual trigger that can be used to position an Overlay. This is useful when you want to position an Overlay relative to a point on the screen that is not an element in the DOM, like the mouse cursor.
272
+
-You can import the `VirtualTrigger` class from the overlay package to create a virtual trigger that can be used to position an Overlay. This is useful when you want to position an Overlay relative to a point on the screen that is not an element in the DOM, like the mouse cursor.
273
273
274
274
The `type` of an Overlay outlines a number of things about the interaction model within which it works:
275
275
@@ -408,8 +408,8 @@ The `overlay` value in this case will hold a reference to the actual `<sp-overla
408
408
409
409
"Fully" in this context means that all CSS transitions that have dispatched `transitionrun` events on the direct children of the `<sp-overlay>` element have successfully dispatched their `transitionend` or `transitioncancel` event. Keep in mind the following:
410
410
411
-
-`transition*` events bubble; this means that while transition events on light DOM content of those direct children will be heard, those events will not be taken into account
412
-
-`transition*` events are not composed; this means that transition events on shadow DOM content of the direct children will not propagate to a level in the DOM where they can be heard
411
+
-`transition*` events bubble; this means that while transition events on light DOM content of those direct children will be heard, those events will not be taken into account
412
+
-`transition*` events are not composed; this means that transition events on shadow DOM content of the direct children will not propagate to a level in the DOM where they can be heard
413
413
414
414
This means that in both cases, if the transition is meant to be a part of the opening or closing of the overlay in question you will need to re-dispatch the `transitionrun`, `transitionend`, and `transitioncancel` events from that transition from the closest direct child of the `<sp-overlay>`.
415
415
@@ -532,7 +532,6 @@ This means that in both cases, if the transition is meant to be a part of the op
The`allow-outside-click`propertyallowsclicksoutsidetheoverlaytocloseit. **Wedonotrecommendusingthispropertyforaccessibilityreasons**asitcancauseunexpectedbehaviorandaccessibilityissues. Whensetto`true`, it configures the focus trap to allow outside clicks, which may interfere with proper focus management and user expectations.
582
-
583
-
```html
584
-
<!-- @deprecated Not recommended for accessibility reasons -->
<p>This overlay can be closed by clicking outside</p>
588
-
</sp-popover>
589
-
</sp-overlay>
590
-
```
591
-
592
-
**Alternative approaches**: Insteadofusing`allow-outside-click`, consider implementing explicit close buttons or using the `type="modal"` or `type="page"` overlay types which provide better accessibility and user experience.
593
-
594
576
#### Styling
595
577
596
578
`<sp-overlay>`elementwillusethe`<dialog>`elementor`popover`attributetoprojectyourcontentontothetop-layerofthebrowser, without being moved in the DOM tree. That means that you can style your overlay content with whatever techniques you are already leveraging to style the content that doesn't get overlaid. This means standard CSS selectors, CSS Custom Properties, and CSS Parts applied in your parent context will always apply to your overlaid content.
@@ -790,9 +772,9 @@ When nesting multiple overlays, it is important to ensure that the nested overla
`The "allow-outside-click" attribute on <${this.localName}> has been deprecated and will be removed in a future release. We do not recommend using this attribute for accessibility reasons. It allows clicks outside the overlay to close it, which can cause unexpected behavior and accessibility issues.`,
// Fallback for testing environments or when SWC is not available
999
-
console.warn(
1000
-
`[${this.localName}] The "allow-outside-click" attribute has been deprecated and will be removed in a future release. We do not recommend using this attribute for accessibility reasons. It allows clicks outside the overlay to close it, which can cause unexpected behavior and accessibility issues.`
1001
-
);
1002
-
}
1003
-
}
1004
-
1005
975
// Manage the open state if the 'open' property has changed.
0 commit comments