single-spa / single-spa-inspector

A devtools extension for single-spa applications
https://single-spa.js.org
MIT License
76 stars 17 forks source link

Overlays do not resize dynamically #36

Closed filoxo closed 5 years ago

filoxo commented 5 years ago

When an app resizes, the overlay does not until it is removed and readded. In this example, navbar-ui had had a banner displayed above it. When I dismissed that banner, the overall size of navbar-ui changed but the overlay is still the original size.

Screen Shot 2019-10-11 at 12 23 55 PM

filoxo commented 5 years ago

Also happens with page resize, which most commonly happens when resizing the devtools with the page as well.

filoxo commented 5 years ago

ResizeObserver sounds like its perfect for this.

joeldenning commented 5 years ago

No support for edge and safari is tough - although maybe that doesn't matter because they can't get the browser extension anyway? Couldn't the functionality be implemented with just the window resize event? https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event

filoxo commented 5 years ago

web-ext doesn't support edge or safari so I'm not sure there's much value in targeting them.

filoxo commented 5 years ago

Oh yea, and also re: window resize, that wouldn't work if the element itself changed in size. For example, my navbar is showing a dismissible banner and if the user does dismiss it, the size of navbar changes but the overlays didn't redraw.

joeldenning commented 5 years ago

I see. Then yeah sounds like your suggested implementation would be a good one. 👍

frehner commented 5 years ago

I'm convinced as well. Good proposal, @filoxo