Skip to content

Bug/Feature: Callout - correct dismissOnClickOrScroll to read event's composedPath when ev.target is wrong #19797

@mlp73

Description

@mlp73

Environment Information

  • Package version(s): 8.29.1

Please provide a reproduction of the bug in a codepen:

  • Render Callout from a shadow-dom (f.eks web-component)

Actual behavior:

Result: whatever event that is triggered from inside the Callout will trigger dismissOnClickOrScroll and closes the Callout
The reason is because isEventTargetOutsideCallout will always be true as ev.target is wrong as referred here: https://javascript.info/shadow-dom-events

Why the event is called from the light-dom whereas the hostElement is in the shadowdom is unclear. But supporting both will make the Callout more robust.

Expected behavior:

dismissOnClickOrScroll gets its target from ev.composedPath and properly calculates isEventTargetOutsideCallout.

Priorities and help requested:

Are you willing to submit a PR to fix? Yes

Requested priority: Blocking - our team cannot use Callout and related components in our project

Products/sites affected: all components using Callout under the hood

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions