We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 411cc73 commit 036f7f8Copy full SHA for 036f7f8
html/js/ejs.js
@@ -90,6 +90,17 @@ window.addEventListener("load", () => {
90
matchBrackets: true,
91
lineNumbers: true
92
})
93
+ let pollingScroll = null
94
+ function pollScroll() {
95
+ if (document.activeElement != editor.getInputField()) return
96
+ let rect = editor.getWrapperElement().getBoundingClientRect()
97
+ if (rect.bottom < 0 || rect.top > innerHeight) editor.getInputField().blur()
98
+ else pollingScroll = setTimeout(pollScroll, 500)
99
+ }
100
+ editor.on("focus", () => {
101
+ clearTimeout(pollingScroll)
102
+ pollingScroll = setTimeout(pollScroll, 500)
103
+ })
104
wrap.style.marginLeft = wrap.style.marginRight = -Math.min(article.offsetLeft, 100) + "px"
105
setTimeout(() => editor.refresh(), 600)
106
if (e) {
0 commit comments