Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContextMenu does not show when mouse is moved with normal speed #7792

Open
kendo-bot opened this issue Apr 5, 2024 · 0 comments
Open

ContextMenu does not show when mouse is moved with normal speed #7792

kendo-bot opened this issue Apr 5, 2024 · 0 comments
Labels
Bug C: ContextMenu FP: Unplanned Sync status with associated Feedback Item jQuery Regression Broken functionality which was working previously SEV: High

Comments

@kendo-bot
Copy link
Contributor

kendo-bot commented Apr 5, 2024

Bug report

The ContextMenu does not show when the mouse is moved normally. It will show only when the mouse is moved very slowly.

Reproduction of the problem

  1. Create a Grid with a custom column command.

  2. Define a ContextMenu that will be displayed when the custom column command is clicked.

  3. Click over a specified column command - the ContextMenu opens.

  4. Move the mouse over another row and click the custom column command - the ContextMenu does not open.

A Dojo sample for reproduction: https://dojo.telerik.com/aYiVUzum

Current behavior

The ContextMenu does not open over every item as expected.

Expected/desired behavior

The ContextMenu must open when clicking each item.

The issue is a regression starting with 2023.1.314 version

Workaround

Add the following script before the ContextMenu initialization:

<script>
  function contains(parent, child) {
      try {
          return $.contains(parent, child);
      } catch (e) {
          return false;
      }
  }

  kendo.ui.ContextMenu.fn.open = function (x, y) {
      var OPEN = "open",
          ACTIVATE = "activate",
          DOCUMENT_ELEMENT = $(document.documentElement),
          NS = ".kendoMenu";
      var that = this;

      x = $(x)[0];

      if (contains(that.element[0], $(x)[0]) || that._itemHasChildren($(x))) { // call parent open for children elements
          kendo.ui.Menu.fn.open.call(that, x);
      } else {
          if (that._triggerEvent({ item: that.element, type: OPEN }) === false) {
              if (that.popup.visible() && that.options.filter) {
                  that.popup.close(true);
                  that.popup.element.parent().kendoStop(true);
              }

              if (!that._triggerFocusOnActivate) {
                  that._triggerFocusOnActivate = that._focusMenu.bind(that);
              }
              that.bind(ACTIVATE, that._triggerFocusOnActivate);
              if (y !== undefined) {
                  var overflowWrapper = that._overflowWrapper();
                  if (overflowWrapper) {
                      var offset = overflowWrapper.offset();
                      x -= offset.left;
                      y -= offset.top;
                  }
                  that.popup.wrapper.hide();
                  that._configurePopupScrolling(x, y);
                  that.popup.open(x, y);
              } else {
                  that.popup.options.anchor = (x ? x : that.popup.anchor) || that.target;
                  that.popup.element.parent().kendoStop(true);
                  that._configurePopupScrolling();
                  that.popup.open();
              }

              DOCUMENT_ELEMENT.off(that.popup.downEvent, that.popup._mousedownProxy);
              DOCUMENT_ELEMENT
                  .on(kendo.support.mousedown + NS + that._marker, that._closeProxy);
          }
      }

      return that;
  };
</script>

Environment

  • **Kendo UI version: 2023.1.314
  • **Browser: [all]
@kendo-bot kendo-bot added the FP: Unplanned Sync status with associated Feedback Item label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug C: ContextMenu FP: Unplanned Sync status with associated Feedback Item jQuery Regression Broken functionality which was working previously SEV: High
Projects
None yet
Development

No branches or pull requests

2 participants