Context menu service breaks PanelMenu #45

Closed
opened 2026-01-29 17:30:38 +00:00 by claunia · 1 comment
Owner

Originally created by @andrewittorio on GitHub (Feb 22, 2021).

Describe the bug
Opening a dialog from a contex menu and then clicking in every part of the page, you will loose your current active page in the Panel menu.

To Reproduce
Open any kind of dialog from a context menu.
Click in any part of your page and you will see in the background your active page in the menu disappearing.

Alternatively link your repo with a sample project that can be run.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 88

Additional context
I saw that the problem does not appear if I change the closeMenuItems function by adding an additional condition testing the menu object:

`closeMenuItems: function (event) {
var menu = event.target.closest('.rz-menu');

//>>
// original line 
//if (!menu) {

// modified line
if (!menu && menu != null) {
//<<

  var targets = document.querySelectorAll(
    '.rz-navigation-item-wrapper-active'
  );

  if (targets) {
    for (var i = 0; i < targets.length; i++) {
      Radzen.toggleMenuItem(targets[i], false);
    }
  }
  document.removeEventListener('click', Radzen.closeMenuItems);
}

},
`

Here a short video :

https://user-images.githubusercontent.com/54446694/108724412-92ad4200-7525-11eb-9d5e-7c9bdc86b1c9.mp4

Thank you,

Originally created by @andrewittorio on GitHub (Feb 22, 2021). **Describe the bug** Opening a dialog from a contex menu and then clicking in every part of the page, you will loose your current active page in the Panel menu. **To Reproduce** Open any kind of dialog from a context menu. Click in any part of your page and you will see in the background your active page in the menu disappearing. Alternatively link your repo with a sample project that can be run. **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: Windows 10 - Browser Chrome - Version 88 **Additional context** I saw that the problem does not appear if I change the closeMenuItems function by adding an additional condition testing the menu object: `closeMenuItems: function (event) { var menu = event.target.closest('.rz-menu'); //>> // original line //if (!menu) { // modified line if (!menu && menu != null) { //<< var targets = document.querySelectorAll( '.rz-navigation-item-wrapper-active' ); if (targets) { for (var i = 0; i < targets.length; i++) { Radzen.toggleMenuItem(targets[i], false); } } document.removeEventListener('click', Radzen.closeMenuItems); } }, ` Here a short video : https://user-images.githubusercontent.com/54446694/108724412-92ad4200-7525-11eb-9d5e-7c9bdc86b1c9.mp4 Thank you,
Author
Owner

@akorchev commented on GitHub (Oct 20, 2021):

Seems to be addressed by 981256287a

@akorchev commented on GitHub (Oct 20, 2021): Seems to be addressed by https://github.com/radzenhq/radzen-blazor/commit/981256287a368d79d34aa4c06bd5ea0f87ddfbc4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#45