leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
445 stars 21 forks source link

java.awt.CheckboxMenuItem is not clickable #93

Closed oeway closed 3 years ago

oeway commented 3 years ago

This is likely a bug, I cannot click any checkbox menu item (regular menu item works). This is the java code adds them. Hope this can be fixed, I will have to replace them into regular menu item for now.

alexp-sssup commented 3 years ago

Checkboxs are now displayed correctly and are clickable with endpoint: https://cjrtnc.leaningtech.com/20200907/loader.js

oeway commented 3 years ago

@alexp-sssup Thanks for fixing this.

However, it doesn't seem to work for me.

I changed back in my jar file to use checkbokMenuItem, and used the latest loader above. If you go to https://ij.imjoy.io (reload once), open an image and click "Image -> Type -> 16bit" for example, nothing happened, and also the display seems wrong. Did I miss anything?

Screenshot 2020-09-07 at 21 07 27
alexp-sssup commented 3 years ago

Make sure that custom page code is not altering the generated menu elements. In particular the fixMenus function looks suspicious.

oeway commented 3 years ago

Make sure that custom page code is not altering the generated menu elements. In particular the fixMenus function looks suspicious.

I afraid no, fixMenus only remove certain items.

I found something wired, some checkboxMenuItem actually works:

Screenshot 2020-09-07 at 23 28 02

The one works are generated by the code here, in the same file, all the ones generated from another function doesn't work.

alexp-sssup commented 3 years ago

I can confirm 100% that fixMenu is causing the problem. The line it.text = it.text.trim(); will erase the elements contained in the menu item.

oeway commented 3 years ago

You are right!!! Just tired and it works! I am so sorry, didn't expect that will cause issue.

oeway commented 3 years ago

The new menu looks awesome BTW, thank you again for the fix!