Skip to content

[Bug] Tooltips Do Not Work With ShadowDOMs #48

@DonIsaac

Description

@DonIsaac

Heyo,

My preact application uses a shadow dom as a mounting point, and tooltips are not appearing. I did some digging through the source code, and I believe I know why.

// ReactHint#toggleEvents, line 30
;(click || hasEvents) && document[action]('click', this.toggleHint)
;(focus || hasEvents) && document[action]('focusin', this.toggleHint)
;(hover || hasEvents) && document[action]('mouseover', this.toggleHint)
;(click || hover || hasEvents) && document[action]('touchend', this.toggleHint)

Events in the shadow dom are not propagated up to document, so toggleHint never fires.

One way that this could be fixed is by allowing users to specify the element where the ReactHint singleton should listen for events

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions