mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
Add repro for #2264
This commit is contained in:
parent
3253e929d5
commit
fbf099e515
3 changed files with 65 additions and 0 deletions
35
test/2264/iframe.html
Normal file
35
test/2264/iframe.html
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
|
<style>
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dev-setup-control {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container"></div>
|
||||||
|
<script src="../../metadata.js"></script>
|
||||||
|
<script src="../dev-setup.js"></script>
|
||||||
|
<script src="iframe.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
22
test/2264/iframe.js
Normal file
22
test/2264/iframe.js
Normal 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();
|
||||||
|
}
|
||||||
|
});
|
||||||
8
test/2264/index.html
Normal file
8
test/2264/index.html
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe src="http://localhost:8088/monaco-editor/test/2264/iframe.html?editor=src" style="width:800px;height:600px;" sandbox="allow-same-origin allow-scripts allow-popups allow-modals allow-forms allow-downloads"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue