Close sharing dialog on Enter when changing the username (#1437)
This commit is contained in:
parent
8cfc64a3ab
commit
519a9ca493
@ -15,12 +15,14 @@ function RoomModal({
|
|||||||
onUsernameChange,
|
onUsernameChange,
|
||||||
onRoomCreate,
|
onRoomCreate,
|
||||||
onRoomDestroy,
|
onRoomDestroy,
|
||||||
|
onPressingEnter,
|
||||||
}: {
|
}: {
|
||||||
activeRoomLink: string;
|
activeRoomLink: string;
|
||||||
username: string;
|
username: string;
|
||||||
onUsernameChange: (username: string) => void;
|
onUsernameChange: (username: string) => void;
|
||||||
onRoomCreate: () => void;
|
onRoomCreate: () => void;
|
||||||
onRoomDestroy: () => void;
|
onRoomDestroy: () => void;
|
||||||
|
onPressingEnter: () => void;
|
||||||
}) {
|
}) {
|
||||||
const roomLinkInput = useRef<HTMLInputElement>(null);
|
const roomLinkInput = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
@ -85,6 +87,7 @@ function RoomModal({
|
|||||||
value={username || ""}
|
value={username || ""}
|
||||||
className="RoomDialog-username TextInput"
|
className="RoomDialog-username TextInput"
|
||||||
onChange={(event) => onUsernameChange(event.target.value)}
|
onChange={(event) => onUsernameChange(event.target.value)}
|
||||||
|
onKeyPress={(event) => event.key === "Enter" && onPressingEnter()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p>{`🔒 ${t("roomDialog.desc_privacy")}`}</p>
|
<p>{`🔒 ${t("roomDialog.desc_privacy")}`}</p>
|
||||||
@ -173,6 +176,7 @@ export function RoomDialog({
|
|||||||
onUsernameChange={onUsernameChange}
|
onUsernameChange={onUsernameChange}
|
||||||
onRoomCreate={onRoomCreate}
|
onRoomCreate={onRoomCreate}
|
||||||
onRoomDestroy={onRoomDestroy}
|
onRoomDestroy={onRoomDestroy}
|
||||||
|
onPressingEnter={handleClose}
|
||||||
/>
|
/>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user