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

Incorrect file name preview [File input component] in case of extra white spaces. #2106

Open
jvuppala01 opened this issue Oct 23, 2024 · 2 comments · May be fixed by #2107
Open

Incorrect file name preview [File input component] in case of extra white spaces. #2106

jvuppala01 opened this issue Oct 23, 2024 · 2 comments · May be fixed by #2107
Labels
bug Something isn't working jira This task is referenced in a story of Jira

Comments

@jvuppala01
Copy link

Describe the bug
File name has multiple continuous white spaces between the words but file input preview combines multiple white spaces into single white space this causes confusion to the users.

To Reproduce

  1. Create a new React app using Vite.
  2. Install @dxc-technology\halstack-react package.
  3. Keep a file name with multiple white spaces as ex: 20 LT Product Specs 1.pdf
  4. select this file using file input component
  5. It can be observed in file input preview 20 LT Product Specs 1.pdf file name is displaying like this.
  6. It can be observed clearly there is a mismatch between actual file name and preview in file input component.

Expected behaviour
Actual file name should be displayed without affecting due to white spaces.
Screenshots
image

image

Additional context

Add labels
file input

Copy link

Thank you for opening an issue! 🚀

Our team will review it as soon as possible. In the meantime, please make sure that you've provided all the necessary details to help us understand and address the issue effectively.

Feel free to contribute and participate in discussions!

@GomezIvann
Copy link
Collaborator

GomezIvann commented Oct 23, 2024

Hello @jvuppala01

Two things here:

  1. You are correct, we are trimming the white spaces from the file names. We are going to fix this since it is not what we want.
  2. It's generally not a good practice to have white spaces in file names, especially in technical or development contexts. While most modern systems can handle white spaces in file names, they can still cause issues in certain situations, such as:
    • Command-line operations: In terminal or script usage, spaces often need to be escaped or enclosed in quotes, which can be cumbersome and lead to errors.
    • URLs: Spaces in URLs are replaced with "%20," making the URL harder to read and manage.
    • Cross-platform compatibility: Some older systems or software may not handle spaces well, leading to potential problems when sharing files.

In any case, this is a fair request, and we will address it.

Thanks for the feedback!

@GomezIvann GomezIvann added the bug Something isn't working label Oct 23, 2024
@Mil4n0r Mil4n0r added the jira This task is referenced in a story of Jira label Oct 23, 2024
@Mil4n0r Mil4n0r linked a pull request Oct 23, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira This task is referenced in a story of Jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants