platform icon indicating copy to clipboard operation
platform copied to clipboard

MenuItem: Disable on click

Open yuriy-fix opened this issue 1 year ago • 0 comments

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 for MenuItems.
  • [ ] MenuItems with setDisableOnClick(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 the setDisableOnClick feature.
  • [ ] Clicking a disabled MenuItem (whether top-level or dropdown) does not trigger any additional actions.
  • [ ] setDisableOnClick(true) does not affect MenuItems with submenus (applicable also when Open on Hover is 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 MenuItem is correctly updated with setEnabled(boolean), ensuring proper handling of changes during the same round trip.
  • [ ] Re-attaching a MenuItem with setDisableOnClick(true) retains the disableOnClick behavior 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)

yuriy-fix avatar Oct 08 '24 06:10 yuriy-fix