mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 14:44:16 +00:00
Disable send button when required player not selected in quick chat (#767)
## Description: This PR prevents players from sending Quick Chat messages that require a player target ([P1]) unless a player has been selected. The Send button is now disabled in such cases and visually dimmed for clarity. ## Please complete the following: - [ ] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: aotumuri <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - The chat send button is now disabled if a required player selection is missing, preventing unintended sends. - **Style** - The chat send button visually indicates when it is disabled with a gray background and a not-allowed cursor. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -173,7 +173,8 @@ export class ChatModal extends LitElement {
|
||||
<button
|
||||
class="chat-send-button"
|
||||
@click=${this.sendChatMessage}
|
||||
?disabled=${!this.previewText}
|
||||
?disabled=${!this.previewText ||
|
||||
(this.requiresPlayerSelection && !this.selectedPlayer)}
|
||||
>
|
||||
${translateText("chat.send")}
|
||||
</button>
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.chat-send-button:disabled {
|
||||
background: #666;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.chat-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user