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

File uploader button labelText changes to name of file when a new file is added #5894

Closed
2 tasks done
Tracked by #7860
Donisius opened this issue Apr 20, 2020 · 5 comments
Closed
2 tasks done
Tracked by #7860

Comments

@Donisius
Copy link

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you're having.
When a file is added using the FileUploaderButton it changes it's labelText to be the same as the file's name.

Is this issue related to a specific component?
FileUploaderButton

What did you expect to happen? What happened instead? What would you like to
see changed?
I would like the labelText of the button to not change when a file is uploaded

What browser are you working in?
Chrome

What version of the Carbon Design System are you using?
10.10.3

Steps to reproduce the issue

  1. Use a file uploader button
  2. Upload a file
  3. See the labelText of the button change to the name of the file

Please create a reduced test case in CodeSandbox

@tw15egan
Copy link
Collaborator

FileUploaderButton will always change the text to be the file text, because it is not displayed anywhere else. Can you try using the regular `

<FileUploader
  multiple={false}
  labelTitle="Im gonna change"
  buttonLabel= 'Add files'
  onChange={event => {
    onFileAdded(event.target.files);
  }}
/>

Screen Shot 2020-04-20 at 11 12 52 AM

@Donisius
Copy link
Author

I initially did it manually using FileUploaderButton because I needed an event to bind to onDelete for the FileUploaderItem. I most likely missed something but I can't seem to find that event when using the regular FileUploader

@emyarod
Copy link
Member

emyarod commented Apr 20, 2020

currently only the drag and drop file uploader has hooks for the delete event, related issue for the standard file uploader here #5851

@Donisius
Copy link
Author

Cool, thanks for the reply! 😄

@emyarod
Copy link
Member

emyarod commented Feb 23, 2021

I believe this issue can be closed given that the drag and drop file uploader has been released, the default file uploader has onDelete hooks (#5851), and the FileUploaderButton is behaving as intended

@emyarod emyarod closed this as completed Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants