Skip to content

Fix custom file input overflow with too long filenames#28497

Closed
MicroDroid wants to merge 3 commits intotwbs:v4-devfrom
MicroDroid:v4-dev
Closed

Fix custom file input overflow with too long filenames#28497
MicroDroid wants to merge 3 commits intotwbs:v4-devfrom
MicroDroid:v4-dev

Conversation

@MicroDroid
Copy link
Copy Markdown

No description provided.

Signed-off-by: Yousef Sultan <yousef.su.2000@gmail.com>
@MicroDroid MicroDroid requested a review from a team as a code owner March 14, 2019 16:13
@MartijnCuppens
Copy link
Copy Markdown
Member

@MicroDroid, could you provide a (Codepen) demo of what exactly this fixes?

@MicroDroid
Copy link
Copy Markdown
Author

MicroDroid commented Mar 14, 2019

@MartijnCuppens there you go https://codepen.io/OverCoder/pen/PLQxaJ

Select a file with a huge filename (or multiple files).

@XhmikosR
Copy link
Copy Markdown
Member

XhmikosR commented Mar 14, 2019

For me it doesn't fix the issue when the overflow: hidden is added in the input. It works if it's specified in .custom-file.

@Johann-S
Copy link
Copy Markdown
Member

I made an example on how to handle that see here: https://bs-custom-file-input.netlify.com/
Example: Example with label containing a child

@MicroDroid
Copy link
Copy Markdown
Author

Oh, that's right, it's my fault I added the property to the wrong selector.

That said, can you see the updated pen? I kind of implemented something similar to what @Johann-S had but with padding instead of hardcoding a 75% width, thus to fill out the entire space properly.

I am not sure using 80px is safe though, and assuming a non-monospace font, I have no idea how to calc() the exact right padding.

If it looks right I'll push it here.

@alecpl
Copy link
Copy Markdown
Contributor

alecpl commented Mar 15, 2019

Reference: #26933. See my solution there.

@MicroDroid
Copy link
Copy Markdown
Author

Alright, based on @foxleigh81's approval I'm going to push the fix I've implemented in the pen in a few moments.

Signed-off-by: Yousef Sultan <yousef.su.2000@gmail.com>
@XhmikosR XhmikosR closed this May 2, 2019
@XhmikosR
Copy link
Copy Markdown
Member

XhmikosR commented May 2, 2019

Fixed in #28511

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 this pull request may close these issues.

6 participants