vue3-datepicker icon indicating copy to clipboard operation
vue3-datepicker copied to clipboard

Submit with enter-press is not working if datepicker is inside form tag

Open marcoschulte opened this issue 4 years ago • 3 comments

Hi icehaunter,

great work on this component! However, I noticed an issue with this component. If it is being placed inside a form, it is not possible anymore to submit the form with a press of enter.

<form v-on:submit.prevent="save">
   <datepicker v-model="foo"/>
   <input type="text" v-model="bar">
   <button type="submit">Speichern</button>
</form>

This form can only be submitted by pressing the button. However, if I move the datepicker component above the opening form tag, I can submit the form if the text input is focused and I press enter.

marcoschulte avatar Aug 26 '21 17:08 marcoschulte

Hello! I'm not sure how you want this to be handled, given that the input is readonly by default, and clicking enter just closes the picker. Would you like a onEnter event to listen to?

icehaunter avatar Jun 04 '23 15:06 icehaunter