Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploader don't reupload if file is the same after delete #1147

Open
Torvaldi opened this issue Jun 29, 2020 · 5 comments
Open

Uploader don't reupload if file is the same after delete #1147

Torvaldi opened this issue Jun 29, 2020 · 5 comments
Labels

Comments

@Torvaldi
Copy link

Versions

package version
react 16.13.1
rsuite 4.7.5

What is the expected behavior?

File just removed should be reuploadable.

What is the current behavior?

If the imported file is the same as the one just deleted, the file is not displayed.

What are the steps to reproduce?

  1. Implements uploader
<Uploader
    autoUpload={false}
    onChange={this.handleChange}
    multiple={false}
    disabled={this.state.value.length > 0}
    ref={ref => {
        this.uploader = ref;
    }}
/>
  1. Add a file to the uploader
  2. Remove it
  3. Add it again - The file should not appear this time
@Torvaldi Torvaldi changed the title Uploader don't reupload if file are the same after delete Uploader don't reupload if file is the same after delete Jun 29, 2020
@eDubrovsky
Copy link

eDubrovsky commented Jun 29, 2020

@Torvaldi It's not Uploader bug, it's an old issue in all browsers.
I fix that in my project by unmount and mount component again after removing files.

const [clearFile, setClearFile] = useState(false)

const scriptClear = () => {
   setFile([])
   setClearFile(true)
   setClearFile(false)
}

{!clearFile && (
   <Uploader onRemove={() =>
      setTimeout(function () {
      scriptClear()
     }, 0)
   }>
)}

@xDiezz
Copy link

xDiezz commented Jul 12, 2020

@Torvaldi It's not Uploader bug, it's an old issue in all browsers.
I fix that in my project by unmount and mount component again after removing files.

const [clearFile, setClearFile] = useState(false)

const scriptClear = () => {
   setFile([])
   setClearFile(true)
   setClearFile(false)
}

{!clearFile && (
   <Uploader onRemove={() =>
      setTimeout(function () {
      scriptClear()
     }, 0)
   }>
)}

There is no such bug in react-filepond

@eDubrovsky
Copy link

@simonguo @simonguo maybe you can fix this in rsuit v5?

@william-deckard
Copy link

Diddo, I am experiencing the same...

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants