apache / royale-asjs

Apache Royale ASJS
Apache License 2.0
374 stars 116 forks source link

Problems with mx:Menu position on PopupButton click. #968

Open sylvainfritsch opened 3 years ago

sylvainfritsch commented 3 years ago

Hello,

I'm using the mx emulation to port an existing application to Royale JS. I'm using mx.controls.PopUpButton to display a menu on click. The position at which the mx.controls.Menu appear change based on the menu widths. The larger is the menu is the offset. It's as if the offset is equal to the menu's width.

As examples, here the button clicked is "PHARMACIE" large offset

And here it is "SOIN" small offsetJPG

I haven't been able to identify the problem yet. And can't say if it comes from Menu, or PopUpButton.

Also as it is my first post here, i'll use this opportunity to thank you all for your great job with this project.

sylvainfritsch commented 3 years ago

I have identified the bug. It comes from the line 350 of PopupButton.as : var point:Point = new Point(/layoutDirection == "rtl" ?/ _popUp.width /: 0/, unscaledHeight + popUpGap);

The comment makes the popup to alway have the right to left behaviour, creating this bug. It's my first time, so i have no idea how to contribute to solve this issue.