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

Collapsed/Expanded Event for Expander Control #5495

Open
amdingler opened this issue Jul 16, 2021 · 5 comments
Open

Collapsed/Expanded Event for Expander Control #5495

amdingler opened this issue Jul 16, 2021 · 5 comments
Labels

Comments

@amdingler
Copy link

Proposal: Collapsed/Expanded Event for Expander Control

Summary

It would be great to be able to access an event to perform an action once the Expander control has completely collapsed or expanded.

Rationale

  • Having these events would signal when the animation is completed. Visual changes to the UI before the expander has completely changed state could overlap with the animation.
  • These events would help in the React Native for Windows implementation for this control which would help make the Expander control accessible to React Native developers as well.

Important Notes

The current Collapsed event is misnamed, and it is fired as soon as the expander begins collapsing.

@amdingler amdingler added the feature proposal New feature proposal label Jul 16, 2021
@ghost ghost added this to Freezer in Feature tracking Jul 16, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jul 16, 2021
@michael-hawker
Copy link
Collaborator

Thought this was resolved in #4394

I think this is basically a duplicate of #4407

@robloo
Copy link
Contributor

robloo commented Jul 17, 2021

I think @amdingler is also focusing on naming and the timing of events here. This was all discussed:

  1. Explanation for current event naming
  2. Discussion about event timing related to animations

To fire events after the animation itself is complete is no simple task. It also would heavily restrict the template itself.

There was also a request to make the events "symmetrical" and have all four: Collapsing, Collapsed, Expanding, Expanded. Bug: Expander Events Naming #4390

@robloo
Copy link
Contributor

robloo commented Jul 17, 2021

The current Collapsed event is misnamed, and it is fired as soon as the expander begins collapsing.

The code fires the event AFTER the visual state is applied here. In-code sequence is correct and was double checked.

The concern about animation continuing after collapsed is fired was noted as mentioned in the above comment. However, there is no correct fix for this. Can you name any other control that waits for an animation which is part of the style to complete before it fires a fundamental event? I don't believe even AnimatedVisualPlayer or AnimatedIcon have such events. In fact doing so breaks the lookless control concept of separation between logic and style. Logic starts to depend directly on style and the code-behind has to get pretty invasive to manage things correctly. Restyling is very difficult at that point.

If it is very important for your app, I do believe the animation times are fixed. You could add a delay of N milliseconds after receiving the Collapsed event to be sure the animation is complete.

Edit: I double checked WPF which also appears to behave the same way.

@mrlacey
Copy link
Contributor

mrlacey commented Jul 17, 2021

Note that if adding a delay on the assumption that there will be animations, need to allow for animations being disabled in the system-wide accessibility settings

@StephenLPeters StephenLPeters added area-Expander team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jul 20, 2021
@StephenLPeters
Copy link
Contributor

@ranjeshj FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

6 participants