Skip to content

Fix panel twodismiss#8710

Merged
kkjeer merged 4 commits intomicrosoft:masterfrom
joschect:fix-panel-twodismiss
Apr 15, 2019
Merged

Fix panel twodismiss#8710
kkjeer merged 4 commits intomicrosoft:masterfrom
joschect:fix-panel-twodismiss

Conversation

@joschect
Copy link
Contributor

@joschect joschect commented Apr 12, 2019

Pull request checklist

Description of changes

Currently the panel will call on dismiss twice when it is closed. I believe that this fix is one of the only ways to get it working without breaking existing functionality. As a possible other fix we could change the comment so that it explicitly states that ondismiss will get called twice. This code change doesn't quite seem right but I can't think of any other way of fixing this bug. Suggestions are welcome.

Focus areas to test

(optional)

Microsoft Reviewers: Open in CodeFlow

@jdhuntington
Copy link
Contributor

I made similar updates to Panel for the fabric-7 branch, specifically in order to make sure isOpen is respected. #8713 We should sync and figure out which (if any) parts we can share.

@size-auditor
Copy link

size-auditor bot commented Apr 12, 2019

Bundle test Size (minified) Diff from master
Panel 182.17 kB BelowBaseline     -6 bytes
Dropdown 213.131 kB BelowBaseline     -6 bytes

ExceedsTolerance  Exceeds Tolerance     ExceedsBaseline  Exceeds Baseline     BelowBaseline  Below Baseline     1 kB = 1000 bytes

@dzearing
Copy link
Member

add test

@dzearing
Copy link
Member

@msft-github-bot auto merge after Jon writes a test.

animation-duration: 0.167s;
animation-fill-mode: both;
animation-name: keyframes from{opacity:0;}to{opacity:1;};
animation-timing-function: cubic-bezier(.1,.25,.75,.9);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this animation is removed? Is it not breaking the animation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this is actually fixing a bug, a currently rendered panel should not have an animation on it. The code reads like the animation should only be added when it's animated in or out. The test as it's written just creates a panel that's already open, which to me means that it shouldn't animate . We can add some extra stuff to check for that. Animations definitely do work though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting that a change of the isOpen from being a state property to a class private property would change a screenshot in that manner, even if the explanation you gave makes perfect sense. Anyways I am glad that everything still works as expected.

animation-duration: 0.167s;
animation-fill-mode: both;
animation-name: keyframes from{opacity:0;}to{opacity:1;};
animation-timing-function: cubic-bezier(.1,.25,.75,.9);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting that a change of the isOpen from being a state property to a class private property would change a screenshot in that manner, even if the explanation you gave makes perfect sense. Anyways I am glad that everything still works as expected.

@joschect
Copy link
Contributor Author

@dzearing I have added the test

@msft-github-bot
Copy link
Contributor

Component perf results:

Scenario Target branch avg total (ms) PR avg total (ms) Target branch avg per item (ms) PR avg per item (ms)
PrimaryButton 98.472 101.451 0.985 1.014
BaseButton 35.831 34.739 0.358 0.347
NewButton 112.449 110.861 1.124 1.109
button 5.000 5.162 0.050 0.052
DetailsRows without styles 188.088 187.868 1.881 1.879
DetailsRows 205.413 202.225 2.054 2.022
Toggles 49.121 50.098 0.491 0.501
NewToggle 70.797 68.538 0.708 0.685

@joschect
Copy link
Contributor Author

@kkjeer I think that this is probably ready to go in!

@kkjeer kkjeer merged commit 743d8bf into microsoft:master Apr 15, 2019
@msft-github-bot
Copy link
Contributor

🎉office-ui-fabric-react@v6.167.0 has been released which incorporates this pull request.:tada:

Handy links:

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panel OnDismiss is called twice

6 participants