question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unused code in FileUploader

See original GitHub issue

Detailed description

while working on #1022 I noticed some divergence in the FileUploader from the vanilla components. Looking for some clarification on how to proceed

Describe in detail the issue you’re having.

When uploading files, the React FileUploader has some logic that will modify the label text. If the user is uploading multiple files, it will change the label text from Add files to the number of files currently being uploaded, and if the user is uploading a single file, the label text will be changed to the name of the file being uploaded. A couple things about the relevant code though:

  1. it doesn’t seem to be present in the vanilla components
  2. it is unreachable in the current React component

should I remove it completely or is this a desirable feature extension from the vanilla implementation?

Is this a feature request (new component, new icon), a bug, or a general issue?

general issue

Is this issue related to a specific component?

FileUploader

What did you expect to happen? What happened instead? What would you like to see changed?

Right now I am working around this issue while refactoring the component, but it might not even be worth keeping since it is different from the vanilla implementation. Would like some input on this matter though.

What version of the Carbon Design System are you using?

6.6.3

Additional information

Current Vanilla and React FileUploader behavior:

kapture 2018-06-22 at 11 59 18

The following behavior is present within React FileUploader but currently unreachable. The idea seems to be that if the user is uploading multiple files, it will change the label text from Add files to the number of files currently being uploaded, and if the user is uploading a single file, the label text will be changed to the name of the file being uploaded. Don’t know if I agree with this behavior but if it needs to be modified I can add in the revised behavior. Otherwise I can remove the unreachable code:

kapture 2018-06-22 at 12 02 57

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
tay-aitkencommented, Jun 25, 2018

thank you! Appreciate you doing that!

1reaction
asudohcommented, Jul 13, 2018

Thank you so much for doing this @emyarod! Just a note - manageStatusPerFile prop in V1 thing is only for contemplating starting with new vs. backward-compatible change. That said, once we see the former wins, we don’t do the latter (or vice versa). Thanks agina!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding unused code in a project : r/typescript - Reddit
Finding unused code in a project ... Is there a way I can find exported classes/types/functions/etc. that are never used inside my project?...
Read more >
How do I use Google Closure compiler to remove unused ...
There are two ways to remove/exclude unused code from your combined output script: The first, involves using ADVANCED_OPTIMIZATIONS ...
Read more >
How to Add a No-Code File Upload Widget to Any Website
The problem is that integrating a file upload widget that is beautiful, optimized, secure and easy to use is not a quick task...
Read more >
Remove unused code - web.dev
This guide will help you get a handle on your project's unused code by showing you how to analyze your project's codebase, and...
Read more >
[SOLVED] User File Upload | Velo by Wix
I am attempting to use the process and code provided from "How to use ... except the top line still reports an unused...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found