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

Custom file input overflow when selecting multiple files #31577

Closed
jacobmllr95 opened this issue Sep 2, 2020 · 6 comments · Fixed by #32160
Closed

Custom file input overflow when selecting multiple files #31577

jacobmllr95 opened this issue Sep 2, 2020 · 6 comments · Fixed by #32160
Labels

Comments

@jacobmllr95
Copy link
Contributor

When the `multiple' property on a custom file input is enabled and a user selects a lot of files, the filenames overflow the file input.

<div class="custom-file">
  <input type="file" class="custom-file-input" id="customFiles" multiple>
  <label class="custom-file-label" for="customFile">Choose files</label>
</div>

getbootstrap com_docs_4 5_components_forms_(iPad Pro)

This overflow issues can be easy fixed by adjusting the .custom-file-label styles a bit:

.custom-file-label {
  white-space: nowrap;
  overflow-x: hidden;
}

getbootstrap com_docs_4 5_components_forms_(iPad Pro) (1)

@mdo
Copy link
Member

mdo commented Sep 4, 2020

This likely needs two separate patches, one for v4.x and one for v5 since we rewrote the component there.

@ms-yogi
Copy link
Contributor

ms-yogi commented Sep 9, 2020

@mdo Can I take this?

@mdo
Copy link
Member

mdo commented Sep 17, 2020

@ms-yogi Go for it!

@XhmikosR
Copy link
Member

Is this still an issue with the latest v4-dev? We landed a patch recently #32145.

@patrickhlauke

@patrickhlauke
Copy link
Member

the patch #32145 fixed the size of the hidden input, not the visible label, so the issue is/was still there. made a patch #32160 (but only added overflow:hidden ... not sure what the benefit/use of the suggested white-space:nowrap was ... happy to add that too if that can be explained a bit?)

v5 is unaffected by this problem, as it uses a completely different approach

Screenshot of v5 new file input - when multiple files are selected, it only shows the number of files and the actual filenames as tooltip

@XhmikosR XhmikosR linked a pull request Nov 16, 2020 that will close this issue
@XhmikosR
Copy link
Member

#32160 was merged, thanks @patrickhlauke!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants