Skip to content

Commit b351b46

Browse files
committed
Add input to the example
1 parent 97354d2 commit b351b46

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

examples/index.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88
display: block;
99
text-align: center;
1010
border: 4px dashed lightgrey;
11-
height: 200px;
12-
line-height: 200px;
11+
padding: 100px;
1312
font-family: sans-serif;
14-
font-size: 1.5em;
1513
}
1614
file-attachment[hover] {
1715
border-color: gold;
1816
}
17+
input {
18+
font-size: inherit;
19+
}
1920
</style>
2021
</head>
2122
<body>
22-
<file-attachment>
23-
Drop files here
23+
<file-attachment input="file">
24+
Drop files here or
25+
<input type="file" id="file" multiple>
26+
<pre></pre>
2427
</file-attachment>
2528

2629
<!-- GitHub Pages development script, uncomment when running example locally and comment out the production one -->
@@ -30,10 +33,10 @@
3033
<script type="module" src="https://unpkg.com/@github/file-attachment-element@latest/dist/index.js"></script>
3134

3235
<script>
33-
const attach = document.querySelector('file-attachment')
34-
attach.addEventListener('file-attachment-accepted', function(event) {
36+
const pre = document.querySelector('pre')
37+
document.addEventListener('file-attachment-accepted', function(event) {
3538
const {attachments} = event.detail
36-
attach.textContent = attachments.map(a => a.file.name).join(', ')
39+
pre.textContent = attachments.map(a => a.file.name).join('\n')
3740
})
3841
</script>
3942
</body>

0 commit comments

Comments
 (0)