We use a custom autocomplete textbox, and it's been working fine with Telerik Controls from 2012.
We've recently upgraded the DLL, and I've noticed that there is a new problem. When the Autocomplete is focused and Escape is being pressed, the textbox still has logical focus, but the keyboard focus is lost (The cursor is still on the textbox, but it is not blinking anymore).
After debugging it, I've found out that KeyTipService.HandleEscape is being called, and this specific code takes the keyboard focus:
if
(
this
.Ribbon !=
null
)
{
#if WPF
Keyboard.Focus(
this.Ribbon.SelectedTab);
#endif
if
(
this
.Ribbon.IsBackstageOpen)
{
this
.Ribbon.IsBackstageOpen =
false
;
}
}
I've tested this issue on a test project, and I can reproduce the issue, even with a regular textbox:
<
telerik:RadRibbonWindow
x:Class
=
"RibbonTakesFocusFromAutoComplete.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
x:Name
=
"contentToDisable"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
telerik:RadRibbonView
Name
=
"MainRibbon"
HelpButtonVisibility
=
"Visible"
HelpCommand
=
"{Binding ShellHelpFileCommand}"
GotKeyboardFocus
=
"MainRibbon_GotKeyboardFocus"
ApplicationName
=
"Bob"
telerik:KeyTipService.IsKeyTipsEnabled
=
"True"
MinimizeButtonVisibility
=
"Visible"
Foreground
=
"Black"
IsBackstageOpen
=
"false"
IsMinimized
=
"False"
>
<
telerik:RadRibbonView.Backstage
>
<
telerik:RadRibbonBackstage
telerik:KeyTipService.AccessText
=
"F"
>
<
telerik:RadRibbonBackstageItem
Header
=
"New"
telerik:KeyTipService.AccessText
=
"N"
Click
=
"RadRibbonBackstageItem_Click"
/>
<
telerik:RadRibbonBackstageItem
Header
=
"Open"
telerik:KeyTipService.AccessText
=
"O"
Click
=
"RadRibbonBackstageItem_Click_1"
/>
</
telerik:RadRibbonBackstage
>
</
telerik:RadRibbonView.Backstage
>
<
telerik:RadRibbonTab
Foreground
=
"Black"
Header
=
"Edit"
telerik:KeyTipService.AccessText
=
"E"
>
<
telerik:RadRibbonGroup
Header
=
"Clipboard"
telerik:ScreenTip.Title
=
"Clipboard"
telerik:ScreenTip.Description
=
"Bla Bla"
telerik:KeyTipService.AccessText
=
"FO"
>
<
telerik:RadRibbonGroup.Variants
>
<
telerik:GroupVariant
Variant
=
"Medium"
Priority
=
"0"
/>
</
telerik:RadRibbonGroup.Variants
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerik:RadRibbonButton
Text
=
"Paste"
Size
=
"Large"
telerik:ScreenTip.Title
=
"Paste"
Click
=
"RadRibbonButton_Click"
telerik:ScreenTip.Description
=
"Paste"
telerik:KeyTipService.AccessText
=
"V"
>
</
telerik:RadRibbonButton
>
</
StackPanel
>
</
telerik:RadRibbonGroup
>>
</
telerik:RadRibbonTab
>
</
telerik:RadRibbonView
>
<
Grid
Grid.Row
=
"1"
>
<
TextBox
Width
=
"100"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
/>
</
Grid
>
</
Grid
>
</
telerik:RadRibbonWindow
>
Run the project, and click the TextBox so it will get keyboard focus. Press the Escape key, and you'll see what I mean.
Is there any workaround?
Can you please fix it.
Thanks