Fix: Avatar preview does not update when same file is selected repeatedly (#8288)
* Fix: Avatar preview does not update when same file is selected repeatedly Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
7600182a35
commit
dbcb56f75e
9 changed files with 48 additions and 3 deletions
|
@ -19,6 +19,7 @@ import React, { useRef, useState } from "react";
|
|||
import { _t } from "../../../languageHandler";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import Field from "../elements/Field";
|
||||
import { chromeFileInputFix } from "../../../utils/BrowserWorkarounds";
|
||||
|
||||
interface IProps {
|
||||
avatarUrl?: string;
|
||||
|
@ -89,6 +90,7 @@ export const SpaceAvatar = ({
|
|||
<input
|
||||
type="file"
|
||||
ref={avatarUploadRef}
|
||||
onClick={chromeFileInputFix}
|
||||
onChange={(e) => {
|
||||
if (!e.target.files?.length) return;
|
||||
const file = e.target.files[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue