@canonical/react-components 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ export type Props = PropsWithSpread<{
28
28
  /**
29
29
  * Function for handling dismissing a chip.
30
30
  */
31
- onDismiss?: () => void;
31
+ onDismiss?: (event: MouseEvent<HTMLButtonElement>) => void;
32
32
  /**
33
33
  * Whether the chip is selected.
34
34
  */
@@ -218,7 +218,11 @@ const SearchAndFilter = _ref => {
218
218
  lead: chip.lead,
219
219
  value: chip.value,
220
220
  key: "search-".concat(chip.lead, "+").concat(chip.value),
221
- onDismiss: () => removeFromSelected(chip),
221
+ onDismiss: event => {
222
+ // Prevent filter chip dismissals from bubbling up and triggering the parent onClick handler
223
+ event.stopPropagation();
224
+ removeFromSelected(chip);
225
+ },
222
226
  selected: true,
223
227
  quoteValue: chip.quoteValue
224
228
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": {