Skip to content

Conversation

aaron-steinfeld
Copy link
Contributor

Description

Today, when moving away from a view with a popup (for example, a modal) any open popovers remain hanging open. This change ties their lifecycle to the underlying component, so the popover overlay will be removed if the trigger itself is destroyed.

Testing

Tested manually

@aaron-steinfeld aaron-steinfeld requested a review from a team as a code owner May 4, 2021 21:30
@codecov
Copy link

codecov bot commented May 4, 2021

Codecov Report

Merging #822 (eed111d) into main (65fc293) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #822      +/-   ##
==========================================
+ Coverage   85.43%   85.44%   +0.01%     
==========================================
  Files         792      792              
  Lines       16198    16199       +1     
  Branches     2070     2071       +1     
==========================================
+ Hits        13838    13841       +3     
+ Misses       2329     2327       -2     
  Partials       31       31              
Impacted Files Coverage Δ
...ojects/components/src/popover/popover.component.ts 96.42% <100.00%> (+0.13%) ⬆️
...ts/components/src/combo-box/combo-box.component.ts 89.71% <0.00%> (+1.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65fc293...eed111d. Read the comment docs.

@github-actions

This comment has been minimized.


// Closing can happen internal to the Popover for things like closeOnBackdropClick. Let the consumer know.
this.subscription = popover.closed$.subscribe(() => this.popoverClose.emit());
this.popover.closed$.subscribe(() => this.popoverClose.emit());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are not unsubscribing from this?

Copy link
Contributor Author

@aaron-steinfeld aaron-steinfeld May 4, 2021

Choose a reason for hiding this comment

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

No longer necessary, because the closed observable ends when we invoke close which now will always happen at or before destroy.

@aaron-steinfeld aaron-steinfeld merged commit 8440694 into main May 4, 2021
@aaron-steinfeld aaron-steinfeld deleted the close-popup-on-destroy branch May 4, 2021 22:47
@github-actions
Copy link

github-actions bot commented May 4, 2021

Unit Test Results

    4 files  ±0  250 suites  ±0   14m 44s ⏱️ -56s
897 tests ±0  897 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
903 runs  ±0  903 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 8440694. ± Comparison against base commit 65fc293.

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

Successfully merging this pull request may close these issues.

3 participants