| 182 | 182 | if (!this.dlg.showModal) { |
| 183 | 183 | this.dlg.classList.add('poly_dialog'); |
| 184 | 184 | dialogPolyfill.registerDialog(this.dlg); |
| 185 | + // Force a vertical reposition after the content |
| 186 | + // (like crop image) has been set |
| 187 | + const resizeObserver = new ResizeObserver((entries) => { |
| 188 | + for (const entry of entries) { |
| 189 | + dialogPolyfill.reposition(entry.target); |
| 190 | + } |
| 191 | + }); |
| 192 | + resizeObserver.observe(this.dlg); |
| 185 | 193 | } |
| 186 | 194 | this.body = this.dlg.querySelector('.popup-body'); |
| 187 | 195 | this.content = this.dlg.querySelector('.popup-content'); |