Add repro for #2264

This commit is contained in:
Alexandru Dima 2020-12-30 00:06:13 +01:00
parent 3253e929d5
commit fbf099e515
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
3 changed files with 65 additions and 0 deletions

22
test/2264/iframe.js Normal file
View file

@ -0,0 +1,22 @@
const init = () => {
loadEditor(function() {
// create the editor
const target = document.getElementById('container');
const editor = monaco.editor.create(target, { language: 'html' });
// load some sample data
(async () => {
const response = await fetch('https://microsoft.github.io/monaco-editor/');
const html = await response.text();
editor.getModel().setValue(html);
})();
});
};
window.addEventListener('DOMContentLoaded', () => {
if (!window.innerWidth || !window.innerHeight) {
window.addEventListener('resize', init, { once: true });
} else {
init();
}
});