@onewelcome/react-lib-components 0.2.2 → 0.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.
- package/dist/react-lib-components.cjs.development.js +5 -3
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +5 -3
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +16 -0
- package/src/ContextMenu/ContextMenu.tsx +5 -1
- package/src/ContextMenu/ContextMenuItem.tsx +3 -1
- package/src/Form/Input/Input.test.tsx +63 -42
|
@@ -821,7 +821,7 @@ var ContextMenu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
821
821
|
};
|
|
822
822
|
|
|
823
823
|
useBodyClick(function (event) {
|
|
824
|
-
return showContextMenu && anchorEl.current !== event.target;
|
|
824
|
+
return showContextMenu && anchorEl.current !== event.target && anchorEl.current !== event.target.parentElement;
|
|
825
825
|
}, function () {
|
|
826
826
|
setShowContextMenu(false);
|
|
827
827
|
}, showContextMenu);
|
|
@@ -891,7 +891,7 @@ var css$P = ".ContextMenuItem_module_contextMenuItem__612daeb6 {\n position: re
|
|
|
891
891
|
var modules_3e93850e = {"context-menu-item":"ContextMenuItem_module_contextMenuItem__612daeb6"};
|
|
892
892
|
n(css$P,{"attributes":{"nonce":"DsPHCoJqXm4vKCqFrm03y1"}});
|
|
893
893
|
|
|
894
|
-
var _excluded$R = ["children", "onClick", "onFocusChange", "onSelectedChange", "hasFocus", "isSelected", "childIndex", "contextMenuOpened", "shouldClick"];
|
|
894
|
+
var _excluded$R = ["children", "onClick", "onFocusChange", "onSelectedChange", "hasFocus", "isSelected", "childIndex", "contextMenuOpened", "shouldClick", "className"];
|
|
895
895
|
var ContextMenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
896
896
|
var children = _ref.children,
|
|
897
897
|
_onClick = _ref.onClick,
|
|
@@ -902,6 +902,7 @@ var ContextMenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
902
902
|
childIndex = _ref.childIndex,
|
|
903
903
|
contextMenuOpened = _ref.contextMenuOpened,
|
|
904
904
|
shouldClick = _ref.shouldClick,
|
|
905
|
+
className = _ref.className,
|
|
905
906
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$R);
|
|
906
907
|
|
|
907
908
|
var innerButtonRef = ref || createRef();
|
|
@@ -918,10 +919,11 @@ var ContextMenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
918
919
|
}, [hasFocus, innerButtonRef, contextMenuOpened]);
|
|
919
920
|
return React.createElement("li", {
|
|
920
921
|
role: "menuitem",
|
|
921
|
-
className: modules_3e93850e["context-menu-item"]
|
|
922
|
+
className: modules_3e93850e["context-menu-item"] + " " + (className != null ? className : "")
|
|
922
923
|
}, React.createElement("button", _extends({}, rest, {
|
|
923
924
|
ref: innerButtonRef,
|
|
924
925
|
"data-focus": hasFocus,
|
|
926
|
+
tabIndex: -1,
|
|
925
927
|
onClick: function onClick(event) {
|
|
926
928
|
_onClick && _onClick(event);
|
|
927
929
|
onSelectedChange && childIndex && onSelectedChange(childIndex);
|