nextcloud-vue icon indicating copy to clipboard operation
nextcloud-vue copied to clipboard

Allow input type file for NcActionInput

Open feefladder opened this issue 2 years ago • 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

feefladder avatar Jul 17 '23 13:07 feefladder

cc @nextcloud/vuejs

szaimen avatar Jul 18 '23 12:07 szaimen

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.

skjnldsv avatar Aug 03 '23 10:08 skjnldsv

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.

feefladder avatar Aug 03 '23 10:08 feefladder