Closed kevinlee11 closed 1 year ago
Deployed Styleguide and Lab.Notes
hey, this introduces a bug, if you quickly click on the show/hide popover button in this PR's styleguide deploy it will wrongly render the popover content inline sometimes:
this doesn't happen if you do it on the latest-stable styleguide
Ah thanks, good catch!
hey, this introduces a bug, if you quickly click on the show/hide popover button in this PR's styleguide deploy it will wrongly render the popover content inline sometimes:
this doesn't happen if you do it on the latest-stable styleguide
:tada: This PR is included in version 18.0.8 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Describe the problem this PR addresses
Doing some memory leak testing and looks like popover poppers weren't being properly destroyed resulting in detached HTML elements.
Digging in there were 2 core issues: 1)
currentPopper
was being accessed inclose
in the actionApi scope instead of the vm scope, so.destroy()
was never being called on the popper instance. 2) Even if 1) was working correctly, theclose
logic in the actionApi is only triggered if the user clicks the action element (e.g. a button). However, if the user clicks outside to close the popover, theclose
logic was never called and thus thedestroy
logic never called (aspopperToDestroy
is never set)Describe the changes in this PR
I don't think there was any need for the logic in
close
for destroying. We can just rely onm-transition-fade-in @after-leave="destroyPopper"
, because leaving the transition indicates the popover is being closed, whether it's a click on the action element, or an outside click. So get rid of thecurrentPopper
variable and just usepopperToDestroy
, setting it as before and using it to destroy when the popover fades away.