Skip to content

Commit 8a63412

Browse files
committed
Don't require input attribute on <file-attachment>
1 parent 2ab7c27 commit 8a63412

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ import '@github/file-attachment-element'
1515
```
1616

1717
```html
18-
<file-attachment directory input="upload">
19-
<input id="upload" type="file" multiple>
18+
<file-attachment directory>
19+
<input type="file" multiple />
2020
</file-attachment>
2121
```
2222

2323
### Optional attributes
2424

2525
- `file-attachment[directory]` enables traversing directories.
26-
- `file-attachment[input]` points to the ID of a file input inside of `<file-attachment>`. Files selected from the `<input>` will be attached to `<file-attachment>`. Supplying an input is strongly recommended in order to ensure users can upload files without a mouse or knowing where to paste files.
26+
- `file-attachment[input]` points to the ID of a file input inside of `<file-attachment>`. If supplied, only files selected from the corresponding `<input>` will be attached to `<file-attachment>`.
2727

2828
### Styling drag state
2929

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ describe('file-attachment', function () {
6161
let fileAttachment, input
6262
beforeEach(function () {
6363
document.body.innerHTML = `
64-
<file-attachment input="upload">
65-
<input type="file" id="upload">
64+
<file-attachment>
65+
<input type="file">
6666
</file-attachment>`
6767

6868
fileAttachment = document.querySelector('file-attachment')

0 commit comments

Comments
 (0)