viclafouch / mui-file-input

A file input designed for the React library MUI
https://viclafouch.github.io/mui-file-input/
MIT License
77 stars 17 forks source link

Parameter to change the number of character before trunking of file name. #21

Closed VincentBe closed 1 year ago

VincentBe commented 1 year ago

Hi,

I have a problem with the file name displayed in the control. It's limited to a certain fixed number of characters. In my case, I expand the control with the "fullWidth" parameter. The border and the size part are correctly expanded along the form but the file name still trunked with about 18 characters "filename_...xyz.uvw" (leaving much of the control empty).

I found in the code that this text is trunked at 20. Is it possible to change this fixed value to a parameter? Then we can choose it in the view (with a default value of 20).

I think, it's not the best solution because of font behavior (non monospaced typefaces) but a easy to implement solution.

Regards,

Vincent

viclafouch commented 1 year ago

Hello !

COuld you share a codesandbox plz ?

yuya-tani commented 1 year ago

Hi.

I have the same issue, how did you solve this? I would appreciate it if you could tell me how to do it.

Best regard.

ver. 2.0.4

image

I think it's probably here, but I would appreciate it if you could pass this as a parameter.

image

viclafouch commented 1 year ago

Hey i

It has been fixed in 2.0.6 ! There is no truncate in JS anymore, CSS handles it now

yuya-tani commented 1 year ago

Hi. Thanks for your quick response. I tried updating to the latest and got the best results. This library is great and easy to use.

thankful to you!

VincentBe commented 1 year ago

Hi,

Sorry I don't have a lot of time for the moment. I will try after my holidays.

Thanks.

Vincent

From: Victor de la Fouchardière @.> Sent: mardi 1 août 2023 15:05 To: viclafouch/mui-file-input @.> Cc: Vincent Becquevort @.>; Author @.> Subject: Re: [viclafouch/mui-file-input] Parameter to change the number of character before trunking of file name. (Issue #21)

Hey i

It has been fixed in 2.0.6 ! There is no truncate in JS anymore, CSS handles it now

- Reply to this email directly, view it on GitHubhttps://github.com/viclafouch/mui-file-input/issues/21#issuecomment-1660271226, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD6AYRKSM472GA3SUVS7US3XTD5HTANCNFSM6AAAAAAZZ3XXUM. You are receiving this because you authored the thread.Message ID: @.**@.>>