Skip to content

BFormFile multiple files selected overflows label text #2667

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

Closed
electrocnic opened this issue Feb 20, 2019 · 7 comments · Fixed by #2902
Closed

BFormFile multiple files selected overflows label text #2667

electrocnic opened this issue Feb 20, 2019 · 7 comments · Fixed by #2902

Comments

@electrocnic
Copy link

OS: Windows,
Chrome,

When I use BFormFile, the content (user-selected Files) will not be trimmed to fit the form:

You can directly try it out in the demo: https://bootstrap-vue.js.org/docs/components/form-file
Just use chrome's debug mode and make the window width small enough that the filename is too long for the form.

The filename will be line-broken, which is not expected.

vue-bootstrap-file-form-bug

@electrocnic electrocnic changed the title BFormFile Multiple Files will not be displayed correctly BFormFile Files will not be displayed correctly Feb 20, 2019
@jacobmllr95
Copy link
Member

@electrocnic Maybe this is an upstream bug from Bootstrap.

Can you please test it here too:
https://getbootstrap.com/docs/4.3/components/forms/#file-browser

@electrocnic
Copy link
Author

@jackmu95 Confirmed.
Whatever, is it somehow possible to provide a prop for this element, where we could provide a lambda which gets the raw output string and one can modifiy it however they want?

:)

@jacobmllr95
Copy link
Member

@electrocnic Can you please create an issue over at Bootstrap and reference this issue so we can close it when it get's fixed.

@tmorehouse
Copy link
Member

This sounds like a css/scss issue with bootstrap v4.3

Basically missing the overflow ellipsis rules.

@tmorehouse
Copy link
Member

We could also add maybe an optional formatter callback prop... which would be passed the array of file objects

@tmorehouse tmorehouse changed the title BFormFile Files will not be displayed correctly BFormFile multiple files selected overflows label text Feb 28, 2019
@tmorehouse
Copy link
Member

You could try adding the following utility classes to the b-form-input:

<b-form-file class="text-nowrap text-truncate" ... ></b-form-file>

Note that due to the way that the the custom control "browse" is rendered with pseudo elements on the label, the text-truncate ellipsis will be hidden underneath the browse button.

@varunsingh87
Copy link

Adding those classes only seems to particular fix the issue:
image

The text does not wrap to a new line, but it also does not stop behind the Browse button. I had to hardcode the width on the specific filename in order to fix this.

Here is my code (just the classes):
<b-form-file class="text-truncate text-nowrap"></b-form-file>

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