Skip to content
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

Sample App Crashes when Searching due to Animation on Item #3701

Closed
1 task done
michael-hawker opened this issue Jan 27, 2021 · 2 comments · Fixed by #3801
Closed
1 task done

Sample App Crashes when Searching due to Animation on Item #3701

michael-hawker opened this issue Jan 27, 2021 · 2 comments · Fixed by #3801
Assignees
Labels
animations 🏮 bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 sample app 🖼
Milestone

Comments

@michael-hawker
Copy link
Member

Describe the bug

If you're typing in search, the Sample App can crash. This appears to be a failure due to an animation based effect on the search result items. There may also be a different similar issue as @avknaidu mentioned they can repro in the existing sample app, but we have since replaced it's animations with the new animation set from #3639.

Steps to Reproduce

  • Can this be reproduced in the Sample App?

Steps to reproduce the behavior:

  1. Open Sample app
  2. Search for something like 'System'
  3. Place mouse over an item so that it gets larger
  4. Modify search (with keyboard)
  5. Crash

Expected behavior

Not crash

Environment

Latest main

Additional context

FYI @Sergio0694

This is crashing in the Scale animation setup in the ItemContainer_PointerExited method of Shell.SamplePicker.cs which is initialized by the GridView SamplePickerGridView on each GridViewItem in SamplePickerGridView_ChoosingItemContainer.

System.ArgumentException
  HResult=0x80070057
  Message=The parameter is incorrect.

element
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

at Windows.UI.Xaml.Hosting.ElementCompositionPreview.SetIsTranslationEnabled(UIElement element, Boolean value)
at Microsoft.Toolkit.Uwp.UI.Animations.AnimationBuilder.Start(UIElement element) in H:\\code\\WindowsCommunityToolkit\\Microsoft.Toolkit.Uwp.UI.Animations\\Builders\\AnimationBuilder.cs:line 69
at Microsoft.Toolkit.Uwp.SampleApp.Shell.ItemContainer_PointerExited(Object sender, PointerRoutedEventArgs e) in H:\\code\\WindowsCommunityToolkit\\Microsoft.Toolkit.Uwp.SampleApp\\Shell.SamplePicker.cs:line 239
@michael-hawker michael-hawker added bug 🐛 An unexpected issue that highlights incorrect behavior sample app 🖼 animations 🏮 labels Jan 27, 2021
@michael-hawker michael-hawker added this to the 7.0 milestone Jan 27, 2021
@michael-hawker
Copy link
Member Author

@Sergio0694 any thoughts here on this issue?

@Sergio0694
Copy link
Member

Taking a look... 👀

@ghost ghost added the In-PR 🚀 label Mar 2, 2021
@ghost ghost added the in progress 🚧 label Mar 2, 2021
@ghost ghost removed the in progress 🚧 label Mar 2, 2021
@ghost ghost closed this as completed in #3801 Mar 3, 2021
ghost pushed a commit that referenced this issue Mar 3, 2021
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->

<!-- 📝 It is preferred if you keep the "☑️ Allow edits by maintainers" checked in the Pull Request Template as it increases collaboration with the Toolkit maintainers by permitting commits to your PR branch (only) created from your fork.  This can let us quickly make fixes for minor typos or forgotten StyleCop issues during review without needing to wait on you doing extra work. Let us help you help us! 🎉 -->


## Fixes #3701
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix (sample app)
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
There is a crash in the items animations when looking for samples. This was unrelated from the actual animation APIs, and the crash was happening because the parent of the `DropShadowPanel` for each item was actually `null` if the items were being swapped by a text change while one was animated, so the animation was being invoked on `null`, resulting in a crash. I've just added two checks to skip the animation out in case the whole list is being refreshed, as the item containers would all be discarded anyway.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
The crash is fixed.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https:/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https:/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [X] Contains **NO** breaking changes
@ghost ghost added Completed 🔥 and removed In-PR 🚀 labels Mar 3, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 2, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
animations 🏮 bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 sample app 🖼
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants