nextcloud-libraries/nextcloud-vue

Allow input type file for NcActionInput

Opened this issue · 3 comments

I want to make an app that does some preprocessing on files before uploading to Nextcloud. For this, I need a file input. However, the NcActionInput does not support type=file :

<NcActionInput
		type="file"
		accept=".csv"
		@submit="$emit('upload-file', $event)">
		<template #icon>
			<UpIcon />
		</template>
</NcActionInput>

<script>
import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput.js'
import UpIcon from 'vue-material-design-icons/ArrowUpThin.vue'
</script>

image
image

I would be happy to PR if people think it is a good idea

cc @nextcloud/vuejs

Not too convinced tbh. Feels like a specific use case, not sure we'll use it anywhere else
But you can easily go around that with a input for binding and another input type file somewhere in your template.

That's what I did in the end. Also I didn't exactly realize that v-model doesn't work on file, while it does work on the rest, so that may be a reason why not to use it.