Skip to content

Commit 4776f12

Browse files
committed
Fix overflow in textarea
1 parent 6691e6a commit 4776f12

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

index.html

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@
168168

169169
.input-box textarea {
170170
margin-bottom: 1px;
171-
overflow-y: hidden
171+
}
172+
173+
.input-box textarea::-webkit-scrollbar {
174+
display: none;
175+
172176
}
173177

174178
.input-icon {
@@ -1724,22 +1728,8 @@ <h5 class="font-weight-bold mb-4">MCP</h5>
17241728
this.images = [];
17251729
},
17261730
handleKeydown(e) {
1727-
if (e.key === "Enter" && (e.altKey || e.shiftKey || e.ctrlKey)) {
1728-
// Alt/Shift + Enter, insert a \n
1729-
e.preventDefault();
1730-
const textarea = e.target;
1731-
// Get the current cursor position
1732-
const start = textarea.selectionEnd;
1733-
1734-
// Insert '\n' at the current cursor position
1735-
const textBefore = this.userMessage.substring(0, start);
1736-
const textAfter = this.userMessage.substring(start);
1737-
this.userMessage = textBefore + '\n' + textAfter;
1738-
setTimeout(() => {
1739-
// Set the cursor position after the inserted '\n'
1740-
textarea.selectionStart = start + 1; // Move the cursor to the position after the newline
1741-
textarea.selectionEnd = start + 1;
1742-
}, 0);
1731+
if (e.key === "Enter" && e.shiftKey) {
1732+
// A new line by default
17431733
} else if (e.key === "Enter") {
17441734
// Only Enter is pressed, send message
17451735
e.preventDefault();
@@ -2660,4 +2650,4 @@ <h5 class="font-weight-bold mb-4">MCP</h5>
26602650
</script>
26612651
</body>
26622652

2663-
</html>
2653+
</html>

0 commit comments

Comments
 (0)