target -> currentTarget

This commit is contained in:
nexy7574 2024-12-22 01:02:19 +00:00 committed by GitHub
parent 9c0d5741cd
commit 1d46df7c0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -117,7 +117,7 @@ const UserInfo = ({ userID }: UserInfoProps) => {
<button title="Set presence to offline" onClick={() => sendNewPresence({...(presence || {}), "presence": "offline"})} type="button">{PresenceEmojis["offline"]}</button> <button title="Set presence to offline" onClick={() => sendNewPresence({...(presence || {}), "presence": "offline"})} type="button">{PresenceEmojis["offline"]}</button>
</div> </div>
<div className="statussetter"> <div className="statussetter">
<form onSubmit={(e) => {e.preventDefault(); sendNewPresence({...(presence || {"presence": "offline"}), "status_msg": ((e.target as HTMLFormElement).children[0] as HTMLInputElement).value})}}> <form onSubmit={(e) => {e.preventDefault(); sendNewPresence({...(presence || {"presence": "offline"}), "status_msg": ((e.currentTarget as HTMLFormElement).children[0] as HTMLInputElement).value})}}>
<input type="text" placeholder="Status message" defaultValue={presence?.status_msg || ""}/><button title="Set status message" onClick={() => alert("Set status message")} type="submit">Set</button> <input type="text" placeholder="Status message" defaultValue={presence?.status_msg || ""}/><button title="Set status message" onClick={() => alert("Set status message")} type="submit">Set</button>
</form> </form>
</div> </div>