Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scss/forms/_form-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// Use disabled attribute instead of :disabled pseudo-class
// Workaround for: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11295231
&[disabled] ~ .form-file-label {
&[disabled] ~ .form-file-label .form-file-text {
background-color: $form-file-disabled-bg;
}
}
Expand Down
12 changes: 12 additions & 0 deletions site/content/docs/4.3/forms/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ The file input is the most gnarly of the bunch and requires additional JavaScrip
</div>
{{< /example >}}

Add the `disabled` attribute to the `<input>` and the custom markup will be updated to appear disabled.

{{< example >}}
<div class="form-file">
<input type="file" class="form-file-input" id="customFileDisabled" disabled>
<label class="form-file-label" for="customFileDisabled">
<span class="form-file-text">Choose file...</span>
<span class="form-file-button">Browse</span>
</label>
</div>
{{< /example >}}

Longer placeholder text is truncated and an ellipsis is added when there's not enough space.

{{< example >}}
Expand Down