From 0b4e2b049d99d12646dddd881d9518fb68e3dcdf Mon Sep 17 00:00:00 2001 From: IvanDanchev Date: Thu, 15 Jan 2026 16:42:06 +0200 Subject: [PATCH 1/3] docs: address weekly feedback --- knowledge-base/drawer-prevent-collapse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge-base/drawer-prevent-collapse.md b/knowledge-base/drawer-prevent-collapse.md index e569d72459..aa20619c41 100644 --- a/knowledge-base/drawer-prevent-collapse.md +++ b/knowledge-base/drawer-prevent-collapse.md @@ -86,7 +86,7 @@ I would like to prevent the Drawer from collapsing when an item from the navigat { SelectedItem = item; - navManager.NavigateTo(SelectedItem.Text); + //navManager.NavigateTo(SelectedItem.Text); } public string GetSelectedItemClass(DrawerItem item) From 29e62f6424c6276396377abdccd48a3ddc08c03c Mon Sep 17 00:00:00 2001 From: IvanDanchev Date: Wed, 22 Apr 2026 17:05:39 +0300 Subject: [PATCH 2/3] docs: update kb example --- knowledge-base/drawer-prevent-collapse.md | 67 +++++++---------------- 1 file changed, 19 insertions(+), 48 deletions(-) diff --git a/knowledge-base/drawer-prevent-collapse.md b/knowledge-base/drawer-prevent-collapse.md index aa20619c41..5164e8d364 100644 --- a/knowledge-base/drawer-prevent-collapse.md +++ b/knowledge-base/drawer-prevent-collapse.md @@ -27,79 +27,50 @@ I would like to prevent the Drawer from collapsing when an item from the navigat ## Solution -1. Use the [Template](slug:drawer-templates#template) to take control over the rendering of the entire component. The Drawer renders as `ul` with `li` elements for the individual items. -2. In order to stop the component from collapsing on item click you need to add the `@onclick:stopPropagation` to the `
  • ` tag. +1. Add a Button and update the value of the `Expanded` parameter in the Button's OnClick event handler. +2. Handle the `ExpandedChanged` event of the Drawer, but don't update the `Expanded` parameter value in the handler. This prevents the Drawer from collapsing on item selection. >caption Stop the Drawer from collapsing on item click ````RAZOR -@* Toggle the expanded or collapsed state only by a button click. Clicking on a Drawer item will navigate you to the value of the Text property of the DrawerItem class. See the SelectAndNavigate method for reference *@ - -@inject NavigationManager navManager - - - + MiniMode="true"> - -
    Content for @SelectedItem?.Text - @SelectedItem?.Description
    +
    @code { - public TelerikDrawer DrawerRef { get; set; } public DrawerItem SelectedItem { get; set; } public bool DrawerExpanded { get; set; } = true; - public IEnumerable Data { get; set; } = new List + + public IEnumerable Data { get; set; } = + new List { - new DrawerItem {Text = "Shopping Cart", Icon = SvgIcon.Cart, Description = "Items in shopping cart"}, - new DrawerItem {Text = "Settings", Icon = SvgIcon.Gear, Description = "My profile settings"}, - new DrawerItem {Text = "Notifications", Icon = SvgIcon.Bell, Description = "My profile notifications"}, - new DrawerItem {Text = "Calendar", Icon = SvgIcon.Calendar, Description = "My events"}, + new DrawerItem { Text = "Inbox", Icon = SvgIcon.Inbox }, + new DrawerItem { Text = "Notifications", Icon = SvgIcon.Bell }, + new DrawerItem { Text = "Calendar", Icon = SvgIcon.Calendar }, + new DrawerItem { Text = "Attachments", Icon = SvgIcon.EnvelopeLink }, + new DrawerItem { Text = "Favourites", Icon = SvgIcon.StarOutline } }; - private void SelectAndNavigate(DrawerItem item) + private void ToggleDrawer() { - SelectedItem = item; - - //navManager.NavigateTo(SelectedItem.Text); + DrawerExpanded = !DrawerExpanded; } - public string GetSelectedItemClass(DrawerItem item) + private void DrawerExpandedChanged(bool newExpanded) { - if (SelectedItem == null) return string.Empty; - return SelectedItem.Text.ToLowerInvariant().Equals(item.Text.ToLowerInvariant()) ? "k-selected" : ""; + // Do not modify the DrawerExpanded value here. } public class DrawerItem { public string Text { get; set; } public ISvgIcon Icon { get; set; } - public string Description { get; set; } } } ```` From a79d591f2d2a07614fed7dfd315d0897a1e682ec Mon Sep 17 00:00:00 2001 From: IvanDanchev Date: Wed, 22 Apr 2026 17:41:56 +0300 Subject: [PATCH 3/3] docs: add pr review suggestion --- knowledge-base/drawer-prevent-collapse.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/knowledge-base/drawer-prevent-collapse.md b/knowledge-base/drawer-prevent-collapse.md index 5164e8d364..af5ccb1b17 100644 --- a/knowledge-base/drawer-prevent-collapse.md +++ b/knowledge-base/drawer-prevent-collapse.md @@ -35,11 +35,13 @@ I would like to prevent the Drawer from collapsing when an item from the navigat ````RAZOR + MiniMode="true" + @bind-SelectedItem="@SelectedItem"> +

    @SelectedItem?.Text

    @@ -64,7 +66,7 @@ I would like to prevent the Drawer from collapsing when an item from the navigat private void DrawerExpandedChanged(bool newExpanded) { - // Do not modify the DrawerExpanded value here. + // Do not modify the DrawerExpanded value here. } public class DrawerItem