Skip to content

Commit

Permalink
Fix prompt overlay on smartphones
Browse files Browse the repository at this point in the history
Related: #12
  • Loading branch information
lmg-anon committed Jan 12, 2024
1 parent 8a66526 commit f41f848
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mikupad.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@
margin: 0;
scrollbar-gutter: stable;
font: inherit;
box-sizing: content-box;
text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
}
html.monospace-dark #prompt-area,
html.monospace-dark #memory-area,
Expand Down Expand Up @@ -244,15 +248,20 @@
}

#prompt-overlay {
word-break: break-word;
white-space: pre-wrap;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
transform: translate(0px, 0px);
background: transparent;
color: transparent;
pointer-events: none;
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
overflow: hidden;
}

Expand Down Expand Up @@ -1548,7 +1557,7 @@
this.nextId = +localStorage.getItem('nextSessionId');
this.dependents = {};
this.saveQueue = [];
this.saveTimer = setInterval(() => this.saveTimerHandler(), 1000);
this.saveTimer = setInterval(() => this.saveTimerHandler(), 500);
this.sessions = {};
this.selectedSession = +localStorage.getItem('selectedSessionId');
this.sessionTemplate = { ...defaultPresets };
Expand Down Expand Up @@ -2531,7 +2540,7 @@
id="prompt-area"
onInput=${onInput}
onScroll=${onScroll}/>
<div ref=${promptOverlay} id="prompt-overlay">
<div ref=${promptOverlay} id="prompt-overlay" aria-hidden>
${promptChunks.map((chunk, i) => {
const isCurrent = currentPromptChunk && currentPromptChunk.index === i;
const isNextUndo = undoHovered && !!undoStack.current.length && undoStack.current.at(-1) <= i;
Expand Down

0 comments on commit f41f848

Please sign in to comment.