Context keep open if changing context, prevents blink and then closure of next context menu

This commit is contained in:
James Barnsley
2021-04-05 19:50:55 +12:00
parent 3639d33b4c
commit 9c903a3fe9
3 changed files with 14 additions and 3 deletions

View File

@ -135391,7 +135391,7 @@ var ContextMenu = /*#__PURE__*/function (_React$Component) {
menu = _this$props3.menu,
hideContextMenu = _this$props3.uiActions.hideContextMenu;
if (menu && $(e.target).closest('.context-menu').length <= 0 && $(e.target).closest('.context-menu-trigger').length <= 0) {
if (menu && $(e.target).closest('.context-menu').length <= 0 && $(e.target).closest('.context-menu-trigger').length <= 0 && !((e.which === 3 || e.button === 2) && ($(e.target).closest('.grid__item').length > 0 || $(e.target).closest('.list__item').length > 0))) {
hideContextMenu();
}
});

File diff suppressed because one or more lines are too long

View File

@ -158,7 +158,18 @@ class ContextMenu extends React.Component {
handleMouseDown = (e) => {
const { menu, uiActions: { hideContextMenu } } = this.props;
if (menu && $(e.target).closest('.context-menu').length <= 0 && $(e.target).closest('.context-menu-trigger').length <= 0) {
if (
menu
&& $(e.target).closest('.context-menu').length <= 0
&& $(e.target).closest('.context-menu-trigger').length <= 0
&& !(
(e.which === 3 || e.button === 2) &&
(
$(e.target).closest('.grid__item').length > 0
|| $(e.target).closest('.list__item').length > 0
)
)
) {
hideContextMenu();
}
}