Closed
Conversation
alecpl
reviewed
Mar 16, 2019
| top: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| position: relative; |
Contributor
There was a problem hiding this comment.
Is this position:relative needed?
Member
Author
There was a problem hiding this comment.
z-index: 3 is set on this for some reason, not sure why but I didn't want to break anything I wasn't aware of. I'll have a look at why this was set and maybe we can indeed remove this.
Contributor
|
I'm not sure this is supported scenario, but that margin trick will not work with .form-control-lg/.form-control-sm without additional code. |
Member
Author
|
Good point, I'll have a look at that |
Contributor
|
I’m not a big fan of the current(v4) implementation using CSS If DOM changes are allowed in v5, I'd like to propose like a following change: <div class="custom-file">
<input type="file" class="custom-file-input" id="customFile">
<label class="custom-file-label" for="customFile">
<span class="custom-file-text">Choose file</span>
<span class="custom-file-button">Browse</span>
</label>
</div>This will not need negative margins. |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #28497
Alternative approach which doesn't depend on the width of the browse button. This solution is also compatible with the non-
.text-truncatecustom input, the text just gets cut off in that case.