Completed
Last Updated: 13 Mar 2023 14:01 by ADMIN
Release R1.2023-Increment.3(18.Jan.2023)
Andy
Created on: 02 Aug 2022 04:52
Category: Toolbar
Type: Bug Report
1
Toolbar's SplitButton redirects twice if "target":"_blank" attribute is set

Bug report

The relevant attributes are applied to the list item instead of the anchor tag of the Toolbar's dropdown

Reproduction of the problem

  1. Run this Dojo
  2. Expand the SplitButton and redirect

Current behavior

Both the current and the newly open tab redirect to the link

Expected/desired behavior

Only the newly open tab should redirect

Environment

  • Kendo UI version: 2022.2.621
1 comment
ADMIN
Stoyan
Posted on: 02 Aug 2022 11:21

Hello Andy,

Until this issue is resolved use the following workaround:
  1. Wait until the Component is rendered
  2. Get the li elements of the SplitButton's popup
  3. Swap its attributes with the anchor tag in it
     $(document).ready( function () {
            var li = $(".k-menu-popup").find("li");
            li.each((ind,item)=>{
                var anchor = $(item).find("a");
                anchor.attr({
                    "id":$(item).attr("id"),
                    "role":$(item).attr("role"),
                    "target":$(item).attr("target"),
                    "data-overflow":$(item).attr("data-overflow"),
                    "data-uid":$(item).attr("data-uid")            
                });
                $(item).attr({
                    "id":null,
                    "role":null,
                    "target":null,
                    "data-overflow":null,
                    "data-uid":null
                });
            })
            
        });

 

Review the behavior of the workaround in this Telerik REPL.

Regards,
Stoyan
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.