Skip to content

Prevent SelectionZone from interfering with nested links and buttons#4544

Merged
ThomasMichon merged 3 commits intomicrosoft:masterfrom
ThomasMichon:selection-link
Apr 15, 2018
Merged

Prevent SelectionZone from interfering with nested links and buttons#4544
ThomasMichon merged 3 commits intomicrosoft:masterfrom
ThomasMichon:selection-link

Conversation

@ThomasMichon
Copy link
Copy Markdown
Member

@ThomasMichon ThomasMichon commented Apr 13, 2018

Overview

Right now, if the user clicks an <a> or <button> within a selectable item in a <SelectionZone>, the selection logic still executes, so the underlying item becomes selected before the default behavior of the child element gets to execute. This can be a problem if changing the selection state reconfigures the elements, or the modal state blocks the next UX events from firing.

To fix this, SelectionZone should not intercept mouseDown or click events dispatched to a child <a>, <button>, or <input> element, unless that element has data-selection-invoke or data-selection-toggle applied.

@ThomasMichon ThomasMichon requested a review from dzearing April 13, 2018 15:11
Copy link
Copy Markdown
Member

@ecraig12345 ecraig12345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but you should probably also have someone more familiar with this code/selection-related issues take a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants