Skip to content

Commit

Permalink
fix custom flyouts not showing with selection handles
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Oct 12, 2023
1 parent 78bef50 commit 4ee9b16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Avalonia.Controls/Primitives/TextSelectionCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ internal bool ShowContextMenu()
{
if (_textBox != null)
{
if (_textBox.ContextFlyout is MenuFlyout flyout)
if (_textBox.ContextFlyout is Flyout flyout)
{
var verticalOffset = (double.IsNaN(_textBox.LineHeight) ? _textBox.FontSize : _textBox.LineHeight) + ContextMenuPadding;

Expand Down Expand Up @@ -324,6 +324,10 @@ internal bool ShowContextMenu()
return true;
}
}
else
{
_textBox.RaiseEvent(new ContextRequestedEventArgs());
}
}

return false;
Expand Down

0 comments on commit 4ee9b16

Please sign in to comment.