platform
platform copied to clipboard
MenuItem: Disable on click
Description
Enable developers to use the setDisableOnClick(boolean) method on MenuItems, similar to the existing API on buttons. This feature will prevent multiple triggering of heavy-running code associated with MenuItems when clicked, ensuring that MenuItems are disabled on click and can only be re-enabled from the server side.
Use cases
As a developer
I want to set the MenuItem to disable on click using setDisableOnClick(boolean)
So that I can prevent the user from repeatedly triggering heavy processes and improve the performance and user experience of the application
As an end user
I want to have the MenuItem disabled after I click it once
So that I can avoid accidentally triggering multiple instances of a resource-intensive process
Acceptance criteria
- [ ] The
setDisableOnClick(boolean)method is available forMenuItems. - [ ]
MenuItems withsetDisableOnClick(true)are disabled immediately after being clicked, including both top-level and dropdown items. - [ ]
MenuItems are only re-enabled from the server, similar to buttons with thesetDisableOnClickfeature. - [ ] Clicking a disabled
MenuItem(whether top-level or dropdown) does not trigger any additional actions. - [ ]
setDisableOnClick(true)does not affectMenuItems with submenus (applicable also whenOpen on Hoveris enabled).- [ ] This behavior should be documented
- [ ] Toggling items respect
setDisableOnClick(true), disabling after toggling and preventing further actions until re-enabled. - [ ] The client-side state of the
MenuItemis correctly updated withsetEnabled(boolean), ensuring proper handling of changes during the same round trip. - [ ] Re-attaching a
MenuItemwithsetDisableOnClick(true)retains thedisableOnClickbehavior correctly.
General criteria
- [ ] APIs reviewed
- [ ] Design
- [ ] Performance
- [ ] UX/DX tests in Alpha
- [ ] Documentation:
- [ ] How to test?
- [ ] Limitations:
Security
- [ ] Security implications have been taken into account (elaborate or link to product security requirement specification if there are implications)