generated from Klectr/KTemplate
chore/limit what file types can be added
This commit is contained in:
parent
f67649b6b7
commit
22918a8d72
@ -8,6 +8,9 @@ export function ImageCardButton() {
|
|||||||
function _handleClick(mouseEvent: MouseEvent) {
|
function _handleClick(mouseEvent: MouseEvent) {
|
||||||
const input = document.createElement('input')
|
const input = document.createElement('input')
|
||||||
input.type = 'file'
|
input.type = 'file'
|
||||||
|
input.accept = ".png,.jpg,.webp,.jpeg"
|
||||||
|
input.multiple = false
|
||||||
|
|
||||||
input.onchange = (e: any) => {
|
input.onchange = (e: any) => {
|
||||||
const file = e.target.files[0]
|
const file = e.target.files[0]
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
|
Loading…
Reference in New Issue
Block a user