fix: scroll parent page to top on iframe load

This commit is contained in:
Björn Fromme committed 2025-01-26 20:59:47 +01:00
1 parent 427539481f
commit dd60ce9688
2 files changed
+15 -2

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import { Controller } from '@hotwired/stimulus'
export default class extends Controller {
connect() {
if ('parentIframe' in window) {
window.iFrameResizer = {
onReady: function () {
window.parentIFrame.scrollTo(0, 0)
}
}
}
}
}