Skip to content

Commit

Permalink
Merge pull request #633 from intechstudio/stable_fixes
Browse files Browse the repository at this point in the history
Stable Fix
  • Loading branch information
SukuWc authored Mar 6, 2024
2 parents b875be3 + 645bafc commit 6c719cf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/renderer/main/user-interface/LineEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,30 @@
beforeUpdate(() => {
editor?.layout();
});
// Save a reference to the original ResizeObserver
const OriginalResizeObserver = window.ResizeObserver;
// Create a new ResizeObserver constructor
window.ResizeObserver = function (callback) {
const wrappedCallback = (entries, observer) => {
window.requestAnimationFrame(() => {
callback(entries, observer);
});
};
// Create an instance of the original ResizeObserver
// with the wrapped callback
return new OriginalResizeObserver(wrappedCallback);
};
// Copy over static methods, if any
for (let staticMethod in OriginalResizeObserver) {
if (OriginalResizeObserver.hasOwnProperty(staticMethod)) {
window.ResizeObserver[staticMethod] =
OriginalResizeObserver[staticMethod];
}
}
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand All @@ -119,6 +143,7 @@
class="{$$props.class} grid grid-cols-1 w-full h-full items-center"
>
<div
id="line-editor"
on:click|preventDefault={() => {}}
on:mousedown|preventDefault={() => {}}
bind:this={monaco_block}
Expand Down

0 comments on commit 6c719cf

Please sign in to comment.