JDK-8268374 : MenuItem's accelerator gets fired even when ContextMenu is set to null
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: openjfx16
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-06-08
  • Updated: 2022-03-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
This scenario was identified while fixing JDK-8244075.
An accelerator of MenuItem should get removed when a Control is removed from Scene and it's ContextMenu is set to null.
Currently the accelerator is not removed and it gets fired if that Control is added back to Scene.
This issue is fixed for Button, but occurs for other Controls.
A test is already included in AcceleratorParameterizedTest
Test name: testAcceleratorShouldNotGetFiredWhenControlsIsRemovedFromSceneThenContextMenuIsSetToNullAndControlIsAddedBackToScene().

The test passes for Button but fails for other controls (Tab, TableColumn, TreeTableColumn).