bsgriggs / mendix-unsaved-changes-message

Mendix widget to block the user from closing the browser, closing the tab, or clicking a Mendix navigation when they have unsaved changes
MIT License
1 stars 1 forks source link

Behavior in two-level navigation menu #2

Open odi76 opened 5 months ago

odi76 commented 5 months ago

Hi Benjamin,

Another issue. I use a Navigation Tree having two level items. I applied the both CCS classes *(unsaved-changes-block and mx-navigationtree).

Though I experience selection action is caught, it is also caught on the menu items of level 1. This results in the following scenario: 1) User selects an L1 item to expand the subitems for navigation. 2) Application asks the confirmation for proceeding. 3) User accepts. 4) Application presents L2 items under L1. 5) User selects an L2 item to navigate. 6) Application asks user to confirm proceeding again. 7) Users accepts again. 8) Application navigates user to the page associated to the menu item.

This duplicated confirmation should be reduced to only 1 which really triggers leaving the page. Do you have any idea?

Thanks in advance!

br, Istvan

bsgriggs commented 5 months ago

Hi Istvan, Unfortunately, this widget does not work with multi-level navigation menus. There's no was to target the sub-menus as they are closed when the page loads and the widget adds the blockers to the page.