You found a bug! We've classified it as
EXTJS-18672
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Sencha Premium User
Toolbar items without text are cut off when overflowed to a menu
Ext JS 6.0.1
Fiddle: https://fiddle.sencha.com/#fiddle/16ud
Screenshot:
toolbaroverflow.png
Tested broken in IE11, current Firefox 45, current Chrome 48
It appears that the height of the menu items currently comes from the text el, which doesn't exist when text is not set.
Setting a zero-width char in text fixes the menu, but introduces an ugly bit of extra space on the toolbar buttons.
-
It's an old bug.
You can try the following workaround to fix it:
Code:
.x-boundlist-item {
min-height: 20px;
}
Change 20px to whatever default triton menu item height is.
-
Thanks, I reported the bug.
-
Another workaround is to add to the text config of items that have no text.
-
Sencha Premium User
Thanks for the workarounds.
hakimio, your workaround works well. Looks like the best way to apply it to the default menu ui would be something like:
Code:
.#{$prefix}menu-item-default {
line-height: $menu-item-height - vertical($menu-item-border-width) - abs($menu-item-text-vertical-offset);
}
Unfortunately, there doesn't seem to be an easy way to apply it to all UIs without doing it manually for each, or copying the entire massive SCSS mixin in order to override. But this is probably good enough for now.
Alex, your suggested workaround of adding a text config does not work since we wish to keep a pure icon when outside the menu. It would be fine if there was a way to define text that only appears when overflowed, but I don't see a way - I've also played with the overflowchange event, but messing with the text there screws up ExtJS's size calcs.
Here's an example fiddle: https://fiddle.sencha.com/#fiddle/170o
As you can see there (if you adjust window size), the normal space and the empty text still size incorrectly in the menu, while the zero-width space works there. However, when viewed on the toolbar itself both the zero-width and the normal space introduce extra padding on the right of the icon. This obviously looks wrong.
-
Sencha Premium Member
Bump. Any ETA? Will fix be in 6.2?
-
Sencha User
Bump. Still a bug in 6.5.3. Any ETA?