Bug report
Toolbar splitButton togglable not working since version 2022.2.621Reproduction of the problem
Reproduction of the problem:
Dojo demo: https://dojo.telerik.com/EvOpoWaj
The toggle event does not fire for splitButton since the 2022.2.621 release
Expected/desired behavior
Toggle event shall fire
Environment
Kendo UI version: 2022.2.621 or newer
Browser: [all]
Hello,
In 2022.3.1109(but starting in 2022.1.119) using the Bootstrap v3 theme(not sure about any of the others), when you have a ToolBar inside a TabStrip, disabled buttons are invisible instead of greyed-out.
A demonstration can be found here: https://dojo.telerik.com/@Stephen/ESuKUqAD
It is due to the opacity being set incorrectly to 0 due to changes in the CSS rules, specifically there is a now a ".k-tabstrip .k-button.k-disabled" rule that has a higher specificity than the "old" rules.
Current/broken rules:
The rules in the last version it worked(2021.3.1207):
While I'm sure I can figure out a workaround, an official workaround/fix would probably be better.
Thanks.
Adding an anchor tag styled as a Kendo button to the Toolbar via a template does not navigate to the set url.
Clicking on the first item should navigate to the set url, similar to plain anchor tag or a button command.
The Kendo UI Toolbar supports keyboard navigation between its items either via TAB/SHIFT+TAB or the RIGHT and LEFT arrow keys (documented here). However, there are some issues:
A Form that has a Toolbar in it is being submitted if the Toolbar SplitButton is pressed.
The Form is being submitted
The Form should not be submitted
Currently, the Kendo UI Toolbar supports adding icons to items by setting the "icon" property as documented here. However, only Kendo's own icons are supported.
In other widgets (like the Grid), adding custom icons (to a toolbar!) is already possible by specifiying an icon class.
However, if you wanted a third-party icon (or one of your own) directly to a standalone Toolbar, you would need to create a whole new template from scratch or replace the DOM element after rendering or use some hacky approach like demonstrated in this DOJO. While the first one means a lot of work, the latter ones are both not very stable.
Therefore, I propose to extend the icon support for Toolbars in general. I can think of two different solutions:
The Kendo UI Toolbar widget supports adding SplitButtons that can contain several options. By default, the dropDown with the options can be opened using ALT+DOWN when the SplitButton is focused. This works as expected. According to the documentation, pressing UP or DOWN should now move the focus to the next or previous item. This happens internally, but there is no visual clue for the user. It is impossible to know which item is currently selected.
This DOJO demonstrates the bug.
When a toolbar with several items is resized so that not all items can be displayed at once anymore, some items should be "moved" to the overflow container. I am, of course, assuming that these items have "overflow" set to "auto", which is the default value. As soon as at least one item is overflown, the overflow button should be displayed. This DOJO creates such an environment.
Now, when you resize the page so that the overflow is activated, you can see that not enough space is reserved for the overflow button. It is (first partially, then fully) hidden behind the rightmost item before this item is finally "moved" to the overflow container.
If you look closely, you can still see parts of the three dots behind the "Toggle" item.
The overflow menu of the Toolbar gets hidden below one of its tools. This issue is replicable in scenarios with a lot of tools or when a Toolbar is opened on a small screen.
At some point, the last visible Toolbar element is hiding the icon of the overflow menu.
The icon of the overflow menu should be constantly visible, no matter the number of elements in the Toolbar or the size of the screen.
The toggle function for the splitButton in the Toolbar are not working as of R1 2022.
The toggle function of the button is not executed.
The toggle function of the button should be executed.
When a custom class is set using the items.menuButtons.attributes option, the custom class is applied, but the default 'k-link k-menu-link' classes are removed from the item
The custom class is applied, but the item is missing the ''k-link k-menu-link' classes
The default classes should not be removed when a custom class is set.
The issue is a regression since 2022.1.119
Assume there is a Toolbar with a splitButton that has a subItem. Both the splitButton and the subItem have clickHandlers configured. As long as the splitButton is not in the toolbar's overflow, everything is working correctly. However, when overflown, clicking on the subItem executes the clickHandler of the splitButton instead of the clickHandler of the subItem.
This behavior can be reproduced in the following DOJO: https://dojo.telerik.com/enanUKan/3. Watch the console output when clicking the splitButton/its subItem.
Two more hints:
Unfortunately, both options are no viable solution for us. Any suggestions?
The Typescript definitions for Kendo UI define the kendo.ui.ToolBarOpenEvent as follows:
interface ToolBarEvent {
sender: ToolBar;
preventDefault: Function;
isDefaultPrevented(): boolean;
}
interface ToolBarOpenEvent extends ToolBarEvent {
SplitButton?: JQuery | undefined;
}
The event is also documented that way in https://docs.telerik.com/kendo-ui/api/javascript/ui/toolbar/events/open. However, the corrersponding method in kendo-toolbar.js:446-453 does the following:
open: function (e) {
var isDefaultPrevented = that.toolbar.trigger(OPEN, { target: element });
if (isDefaultPrevented) {
e.preventDefault();
return;
}
that.adjustPopupWidth(e.sender);
},
The title "more tools" when hovering over the button to show additional tools is not translated when a different culture/messages is loaded.
The problem can be seen on the following dojo link: https://dojo.telerik.com/UMOdULAM/2
The Toolbar's overflowAnchor property is missing from the Kendo typing definitions. It is also not available in the Toolbar's API.
Typing definitions for overflowAnchor are missing.
The overflowAnchor property should be available for the Toolbar and added to the API as well.
Method to reset the menuButton items of a toolbar's splitbutton dynamically or to have a datasource that can be refreshed/reloaded.
This is a regression introduced in R1 2020. To reproduce it, set a menu button within a splitButton as initially hidden. Then show it with the ToolBar's show
API method.
Dojo example.
"btn2" is shown as expected, but a js exception is thrown:
kendo.all.js:91805 Uncaught TypeError: Cannot read property 'refresh' of undefined
No js exceptions
The documentation at https://docs.telerik.com/kendo-ui/api/javascript/ui/toolbar/configuration/items.menubuttons does not mention the children of a splitButton can have their own click handlers. It's not present in the typings either.
However, this does work: https://dojo.telerik.com/@GaloisGirl/UYeBewEX
Somewhat related is this bug: https://github.com/telerik/kendo-ui-core/issues/4542 . Documenting the behavior would be useful in accurately describing this bug.
In the KendoToolBar item configuration, there is currently a property called "overflow". The values of this property are: "never", "always", and "auto" (default). If the item.overflow value is set to "never" then the item remains in the toolbar and is not added to the overflow menu when the window shrinks. If the value is set to "always" or "auto", then the item is displayed in the overflow menu. The problem, however, is that sometimes you may want a toolbar item to disappear when the page shrinks, but you don't want or need it in the overlow menu. A specific example is a toolbar item of type "separator". When the separator item.overflow is set to "auto", it adds a gap in the overflow menu between other items. I don't want this gap. Therefore, I set the separator item.overflow to "never". Unfortunately, this means that the separator remains on the toolbar. In the case where I have several separators in the toolbar with overflow set to "never", these all just stack up next to each other in the toolbar as the window is shrunk. I want them to disappear, but also not show up in the overflow menu. An overflow value of "hidden" could solve this problem.