You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ToolTip throws an unhandled NotSupportedException when opening (or closing) for a TextElement that's no longer owned by any (Rich)TextBlock.
This happens because to position itself and to check for safe area, ToolTip calls CCoreServices::GetTextElementBoundingRect that finally leads to CTextElement::GetTextPointer, that returns E_NOT_SUPPORTED whenever it fails to retrieve its parent.
This is quite easy to trigger in scenarios where the same RichTextBlock is being recycled and its Blocks are populated from code behind (ie within a ListView.ItemTemplate)
The workaround is to keep track of all the visible hyperlinks and to manually set their tooltip to null before cleaning the RichTextBlock blocks.
Steps to reproduce the bug
Minimal repro, run, move the cursor to "Here", wait for the tooltip to appear, click the link.
When moving the mouse, the app will crash.
Note that marking the unhandled exception as handled (from Application.UnhandledException) leads in the exception being thrown over and over again until the process is finally terminated.
Something that seems to work tho is to retrieve the open popups in the handler by using VisualTreeHelper and to then manually set IsOpen = false for the ToolTip contained in the Popup from the collection.
Describe the bug
ToolTip throws an unhandled
NotSupportedException
when opening (or closing) for aTextElement
that's no longer owned by any(Rich)TextBlock
.This happens because to position itself and to check for safe area,
ToolTip
callsCCoreServices::GetTextElementBoundingRect
that finally leads toCTextElement::GetTextPointer
, that returnsE_NOT_SUPPORTED
whenever it fails to retrieve its parent.This is quite easy to trigger in scenarios where the same
RichTextBlock
is being recycled and itsBlocks
are populated from code behind (ie within aListView.ItemTemplate
)The workaround is to keep track of all the visible hyperlinks and to manually set their tooltip to null before cleaning the
RichTextBlock
blocks.Steps to reproduce the bug
Minimal repro, run, move the cursor to "Here", wait for the tooltip to appear, click the link.
When moving the mouse, the app will crash.
Expected behavior
No response
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.4.4: 1.4.231219000
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: