Skip to content

Commit

Permalink
Merge pull request #500 from digitalnsw/bugfix/upload-button
Browse files Browse the repository at this point in the history
Updates file upload component to hide input element
  • Loading branch information
oisa authored Jan 21, 2025
2 parents 952dfbe + 8faea18 commit 278cefa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/file-upload/_file-upload.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<span class="nsw-form__helper nsw-form__helper--error" id="{{id}}-error-text"><span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">cancel</span>{{error-text}}</span>{{/if}}{{#if valid-text}}
<span class="nsw-form__helper nsw-form__helper--valid" id="{{id}}-valid-text"><span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">check_circle</span>{{valid-text}}</span>{{/if}}
<div class="nsw-file-upload{{#if js}} js-file-upload{{/if}}"{{#if replace}} data-replace-files{{/if}}>
<input type="file" class="nsw-file-upload__input" name="{{id}}" id="{{id}}"{{#if helper-text}} aria-describedby="{{#if helper-text}}{{id}}-helper-text{{/if}}"{{/if}}{{#if error-text}} aria-invalid="true"{{/if}}{{#if accept}} accept="image/*,.pdf"{{/if}}{{#if multiple}} multiple{{/if}}>
<input id="{{id}}" type="file" class="nsw-file-upload__input" name="{{id}}"{{#if helper-text}} aria-describedby="{{#if helper-text}}{{id}}-helper-text{{/if}}"{{/if}}{{#if error-text}} aria-invalid="true"{{/if}}{{#if accept}} accept="image/*,.pdf"{{/if}}{{#if multiple}} multiple{{/if}}>
<label for="{{id}}" class="nsw-file-upload__label nsw-button nsw-button--dark-outline-solid">Select file</label>
</div>
4 changes: 4 additions & 0 deletions src/components/file-upload/_file-upload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

&__input {
position: absolute;
width: 0;
height: 0;
opacity: 0;
z-index: -1;

&:disabled {
+ .nsw-file-upload__label {
Expand Down Expand Up @@ -53,6 +56,7 @@

.nsw-icon-button {
@include link-dark();
cursor: pointer;

&:hover {
.nsw-section--invert & {
Expand Down
24 changes: 24 additions & 0 deletions src/docs/content/about/whats-happening.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ meta-index: true
</tr>
</thead>
<tbody>
<tr>
<td>v3.18.6</td>
<td>22.01.25</td>
<td>
<h4>Patches</h4>
<ul>
<li>Fixes separate issue with file upload component where the input element overlapped the upload button (label element)</li>
<li>Code snippet correction within documentation</li>
</ul>
</td>
<td><a target="_blank" href="https://github.com/digitalnsw/nsw-design-system/releases/tag/v3.18.6">Code kit</a></td>
</tr>
<tr>
<td>v3.18.5</td>
<td>13.01.25</td>
<td>
<h4>Patches</h4>
<ul>
<li>Issue #468 resolution: Fixes an issue where removing files from the file upload list does not remove them from the upload action</li>
<li>Updates and fixes to documentation content links</li>
</ul>
</td>
<td><a target="_blank" href="https://github.com/digitalnsw/nsw-design-system/releases/tag/v3.18.5">Code kit</a></td>
</tr>
<tr>
<td>v3.18.4</td>
<td>10.12.24</td>
Expand Down

0 comments on commit 278cefa

Please sign in to comment.