Skip to content

Commit

Permalink
Merge pull request #122 from pboivin/fix/iframe-refresh-1x
Browse files Browse the repository at this point in the history
[1.x] Backport fix #121
  • Loading branch information
pboivin authored Feb 28, 2024
2 parents 43ef5fd + 9da72b1 commit 245fdda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/dist/filament-peek.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions resources/js/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,9 @@ document.addEventListener('alpine:init', () => {

if (iframe && iframe.contentWindow) {
this._iframeScrollPosition = iframe.contentWindow.scrollY;

setTimeout(() => {
const iframe = this.$refs.previewModalBody.querySelector('iframe');
iframe.onload = () => {
iframe?.contentWindow?.scrollTo(0, this._iframeScrollPosition || 0);
}, 60);
}
}
} catch (e) {
// pass
Expand Down

0 comments on commit 245fdda

Please sign in to comment.