H.get bind in finaliser not called if action that removes the portal from DOM is emitted from within the portalled component itself
Closed this issue · 1 comments
Really weird one. I am not sure if this is a bug in this library or in Halogen itself...
So if I have a portalled component, say a modal, and emit an action from within that portalled component which results in the portal being removed in the next render, it does not properly finalise the portal component.
This is due to the H.get
call in the finaliser never binding.
You can see in the example below that the finaliser is called, but the log of the state returned from H.get
is never called.
See in the video below that the state of the parent component correctly updates ("modal is closed") but the portalled modal is never removed from the DOM. But the portalled component maybe is stopped (or otherwise broken) from Halogen's point of view as it no longer handles actions or anything.
Reproduction here: https://github.com/noisyscanner/halogen-portal-bug
e082496a-e7da-453d-9fc2-8f4ee7f85e64.mp4
People seem to run into issues with slots not being removed or otherwise behaving strangely when using portals. I'm not sure what the root is, and haven't investigated why simply because I changed jobs shortly after releasing this library and haven't used Halogen in anger since.
Here are some potentially related issues: