Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
rkulinski committed Mar 2, 2022
1 parent 2d3d6af commit 0aaa957
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/allow-event-bubbling-for-all-controls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-select': patch
---

Replace stopPropagation with target check.
7 changes: 6 additions & 1 deletion packages/react-select/src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,11 @@ export default class Select<
onControlMouseDown = (
event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>
) => {
// Event captured by dropdown indicator
// @ts-ignore
if (event.target.closest('.DropdownIndicatorContainer')) {
return;
}
const { openMenuOnClick } = this.props;
if (!this.state.isFocused) {
if (openMenuOnClick) {
Expand Down Expand Up @@ -1202,7 +1207,6 @@ export default class Select<
this.openMenu('first');
}
event.preventDefault();
event.stopPropagation();
};
onClearIndicatorMouseDown = (
event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>
Expand Down Expand Up @@ -1776,6 +1780,7 @@ export default class Select<

return (
<DropdownIndicator
className="DropdownIndicatorContainer"
{...commonProps}
innerProps={innerProps}
isDisabled={isDisabled}
Expand Down

0 comments on commit 0aaa957

Please sign in to comment.