Add Send button and inline keydown handler for chat
Belt-and-suspenders: inline onkeydown on textarea ensures Enter works regardless of JS event listener registration order, plus a visible Send button as clickable fallback.
This commit is contained in:
parent
c0ec5ded04
commit
844ed05cf0
2 changed files with 21 additions and 1 deletions
|
|
@ -425,6 +425,25 @@ p {
|
|||
/* Message input area */
|
||||
#message-form {
|
||||
margin-top: var(--space-3);
|
||||
display: flex;
|
||||
gap: var(--space-2);
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
#send-button {
|
||||
padding: var(--space-2) var(--space-4);
|
||||
background-color: var(--button-primary);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
min-height: 60px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#send-button:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
#message, .message-edit {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
|
||||
<!-- Form for sending messages -->
|
||||
<form id="message-form">
|
||||
<textarea id="message" placeholder="Type your message..."></textarea>
|
||||
<textarea id="message" placeholder="Type your message..." onkeydown="if(event.key==='Enter'&&!event.shiftKey){event.preventDefault();sendMessage();}"></textarea>
|
||||
<button type="submit" id="send-button">Send</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue