-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Restore nested press events in Text, and prevent crash. #7507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 7d293b3.
That bug is about animations on RS5, is that the right link? |
asklar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fix you want instead of reverting it all is to close the "if (try as framework element)" block right after assigning tag. That way if we didn't assign it, tag will still be null
|
Fixed the bug/PR link in description, and replied to comment thread. |
| return fe.GetValue(xaml::FrameworkElement::TagProperty()).try_as<winrt::IPropertyValue>(); | ||
| } | ||
|
|
||
| inline int64_t GetTag(XamlView view) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, another option is to return optional<int64_t> which might be nicer than using -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice idea. Would I then return early from a function calling this and getting an empty optional (or a -1 for that matter)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes same idea, instead of checking for special -1 value you just check foo.has_value()
This reverts commit 7d293b3.
#6692 fixed a crash we experienced in the e2e app when clicking on the test result hyperlink (a
TextBlockcreated outside of RNW, which didn't have a Tag, and our hit test crashed when trying to access the TagProperty which wasn't there.)However, this broke the entire hit testing algorithm for nested Text elements - the added check for whether an element was a
FrameworkElementbefore calling el.GetValue(TagProperty) skips the iteration overInlineelements of aSpanin aTextBlock, because they're not FE.Instead, using
ReadLocalValuesince it returnsUnsetValuein case a dependency property is not present on an element.Microsoft Reviewers: Open in CodeFlow