Skip to content

fix(svg): allow click events to Power BI host for visual acivation#124

Open
ansaganie wants to merge 2 commits into
microsoft:mainfrom
ansaganie:fix/svg-click-propagation
Open

fix(svg): allow click events to Power BI host for visual acivation#124
ansaganie wants to merge 2 commits into
microsoft:mainfrom
ansaganie:fix/svg-click-propagation

Conversation

@ansaganie

Copy link
Copy Markdown

Allow click events to bubble to Power BI host for visual activation

…tivation

Remove stopPropagation/stopImmediatePropagation from clickComponentHandler so that
click events can bubble up to the Power BI host container, which is how the host
detects that a visual should be activated and its settings shown in the format pane.

To prevent the pre-existing double-dispatch problem (child element click bubbling to
the SVG root and triggering a second onClick dispatch that cleared the selection),
add a target===currentTarget guard in bindEvents so the SVG click handler only fires
for direct background clicks, not for clicks that bubbled from child elements.

Also fix visualBuilder.ts: pass this.element (HTMLElement) directly to PowerKPI
constructor instead of this.element[0] (which is undefined) so unit tests that
query the DOM actually work.
@ansaganie ansaganie changed the title fix(svg): allow click events to bubble to Power BI host for visual ac… fix(svg): allow click events to Power BI host for visual acivation Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant