I have a panel bar and I have components in those panels bars and some of them have text boxes I noticed that when I am entering text in those and hit enter the space bar the panel collapses, is there a way to prevent this?
===Admin Edit===
The issue stems from the fact the keydown bubbles out of the item content template. While waiting for a fix, a workaround would be to manually stop the propagation of the keydown.
<TelerikPanelBar Data="@Items">
<PanelBarBindings>
<PanelBarBinding>
<ContentTemplate>
@{
var item = context as PanelBarItem;
<div onkeydown="stopPropagation(event)">
<TelerikTextArea @bind-Value="item.Text"></TelerikTextArea>
</div>
}
</ContentTemplate>
</PanelBarBinding>
</PanelBarBindings>
</TelerikPanelBar>
@* move this script to a separate file in production *@
<script suppress-error="BL9992">
function stopPropagation(e) {
e.stopPropagation();
}
</script>
@code {
public List<PanelBarItem> Items { get; set; }
public class PanelBarItem
{
public string Text { get; set; }
public List<PanelBarItem> Items { get; set; }
}
protected override void OnInitialized()
{
Items = new List<PanelBarItem>()
{
new PanelBarItem() { Text = "Item 1" },
new PanelBarItem() { Text = "Item 2" }
};
base.OnInitialized();
}
}