Declined
Last Updated: 20 Jun 2022 13:09 by ADMIN
Alan
Created on: 13 Jun 2022 14:28
Category: UI for Blazor
Type: Bug Report
0
Material icons in Drawer template not displayed correctly if icon name has underscore

In the example below, the home icon is displayed correctly but the two with underscores are not.  Moving the span outside the drawer does display correctly.

<TelerikRootComponent>
    <TelerikDrawer Data="@NavigablePages"
                   @bind-Expanded="@DrawerExpanded"
                   MiniMode="true"
                   Mode="@DrawerMode.Push"
                   @ref="@DrawerRef"
                   @bind-SelectedItem="@SelectedItem">
        <Template>
            <div class="k-drawer-items">
                <ul>
                    <li class="k-drawer-item" style="white-space:nowrap">
                        <span class="k-icon material-icons" style="margin-right: 8px;">home</span>
                        @if (DrawerExpanded)
                        {
                            <span class="k-item-text">Home</span>
                        }
                    </li>
                    <li class="k-drawer-item" style="white-space:nowrap">
                        <span class="k-icon material-icons" style="margin-right: 8px;">shopping_cart</span>
                        @if (DrawerExpanded)
                        {
                            <span class="k-item-text">Shopping Cart</span>
                        }
                    </li>
                    <li class="k-drawer-item" style="white-space:nowrap">
                        <span class="k-icon material-icons" style="margin-right: 8px;">content_paste_search</span>
                        @if (DrawerExpanded)
                        {
                            <span class="k-item-text">Clipboard</span>
                        }
                    </li>
                </ul>
            </div>
        </Template>
        <DrawerContent>
                <div class="content px-4">
                    @Body
                </div>
            </div>
        </DrawerContent>
    </TelerikDrawer>
</TelerikRootComponent>

1 comment
ADMIN
Dimo
Posted on: 20 Jun 2022 13:09

Hello Alan,

The k-icon CSS class applies a special font and is intended to be used only with the Telerik icons. In your case, please remove it, because it conflicts with the Material styles.

If you need some other styles, which k-icon applies currently, please add them separately.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.