Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
Ext6.5.1 Classic:Buttons inside a menu get resized after first visit
Hi,
I have a menu with buttons, these buttons are having some widths specified, for the first time the buttons show up with specified widths, but later on wards they get resized to a bigger size.
Also, when using button as item, some unused space on both sides and a vertical separator appears on the menu.
Fiddle: https://fiddle.sencha.com/#view/editor&fiddle/287c
Steps to replicate:
1. Browse the fiddle
2. Click btn1, both the buttons in the menu show up with specified shorter widths as expected, but notice that there is some unused space on both left and right sides of the menu and a vertical separator appears too.
3. Click btn1 again, this time they show up with bigger widths.
Note: These problems do not happen in Modern.
Thank you,
Nagarjuna
-
Sencha User
Why oh why are you insisting on using Buttons in a Menu?
Just let Menus do their thing with MenuItems.
-
Sencha User
That was the requirement in our product
, part of it is a html drag-drop editor and users should now be able to drop menu controls whose items are buttons. I can use menu items if I can substitute the buttons with menu items completely, but seeing the docs I assumed I can use any component as an item for the menu.
-
Sencha User
You can use buttons if you insist. But it just breaks the intuitive behaviour that was carefully written in Menuitem.
I see no width bugs in your fiddle anyway, it behaves as expected from the configuration.
-
Sencha User
forgot to change it back to Classic(works as expected in Modern), changed it now, also try with preview mode - https://fiddle.sencha.com/fiddle/287c/preview
-
Sencha User
It's probably a bug, but you're working against the framework, not only in shoehorning Buttons into Menus.
But also in insisting on hardcoding the width of the buttons. A Menu uses flexbox layout, flex-direction column; align-items: stretch, and has a min-width of 120
So it wants to make the child items stretch, but you are asking them to be 50 (why? ew!)
Classic's layout system is in javascript and has to choose. There's a bug somewhere deep down in there which is not going to get fixed.