@codacy/ui-components 0.64.9 → 0.64.10

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.
@@ -15,7 +15,9 @@ export var DropdownItem = function DropdownItem(_ref) {
15
15
  props = _objectWithoutProperties(_ref, _excluded);
16
16
 
17
17
  var dropdownContext = useDropdownContext();
18
- var handleClick = useCallback(function () {
18
+ var handleClick = useCallback(function (event) {
19
+ if (event) event.stopPropagation();
20
+
19
21
  if (!disabled) {
20
22
  if (!!value) dropdownContext.setValue(value);
21
23
  if (!!onClick) onClick(value);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const useDropdownTrigger: () => {
3
- onClick: () => void;
3
+ onClick: (event?: React.MouseEvent) => void;
4
4
  open?: boolean | undefined;
5
5
  setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
6
6
  setValue: import("react").Dispatch<import("react").SetStateAction<import("../Dropdown.types").DropdownValueType>>;
@@ -3,7 +3,8 @@ import { useCallback, useEffect } from 'react';
3
3
  import { useDropdownContext } from '../Dropdown';
4
4
  export var useDropdownTrigger = function useDropdownTrigger() {
5
5
  var dropdownContext = useDropdownContext();
6
- var onClick = useCallback(function () {
6
+ var onClick = useCallback(function (event) {
7
+ if (event) event.stopPropagation();
7
8
  dropdownContext.setOpen(function (isOpen) {
8
9
  return !isOpen;
9
10
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/ui-components",
3
- "version": "0.64.9",
3
+ "version": "0.64.10",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",