Hello,
I am working with the FileManager component and I noticed an odd behavior when implementing custom context menu options.
Please refer to this minimal example that reproduces the issue.
How to replicate the problem:
1- Make sure that the component is sufficiently large (width-wise) so that right-clicking on an item does not automatically add a Preview option.
2- Right-click on file.json.
The default context menu of the browser should be displayed.
Press the esc key to close it.
3- Right-click on file.txt.
The custom context menu implemented should be displayed, with one option TEXT FILE
4- Right-click on file.ts.
The custom context menu implemented should be displayed, with on option TYPESCRIPT FILE
5-Right-click on file.json.
The default context menu of the browser should be displayed.
Press the esc key to close it and notice that the custom context menu is also open, with the option TYPESCRIPT FILE
On step 5, I am not expecting to have a custom menu displayed since the custom menuOptions function returns an empty array for files that are not txt or ts.
But its seems that the menu options from the previous clicked items are kept and reused instead internally somehow.
Please, also notice that, on step 5, if you click on a directory (e.g. folder) instead (either in the main view or the tree view), the same behavior is observed.
If I try to sumarize, the custom context menu of the previous right-clicked item (if any) is displayed instead if you right-click on another item that should not have one (i.e. returns an empty array in menuOptions).
Is this normal? Is it a bug?
Is there a missing configuration that I may have overlooked?
Best regards,