-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datepicker component no longer editable #881
Comments
A reproducible example: <script setup lang="ts">
import { ODatepicker } from '@oruga-ui/oruga-next';
import { ref } from 'vue';
const date = ref(new Date());
const range = ref([new Date(), new Date()]);
</script>
<template>
<OField label="Date">
<ODatepicker v-model="date" :readonly="false" />
</OField>
<OField label="Date Range">
<ODatepicker v-model="range" :readonly="false" range />
</OField>
</template> Trying to edit either date via the keyboard just clears it out once the control loses focus. I suspect this logic is what's clearing the value. |
@blm768 Thanks for the fix, seems good. @theonelucas Maybe we should also change the default value of readonly to false instead of true? What do you think? |
That would be closer to the standard behavior of the |
Yeah you are right, that is how it should be. @blm768 Could you update your PR or make another one :)? |
Overview of the problem
Oruga latest
Vuejs version: latest
OS/Browser: any
Description
In the vue 2 version of oruga, the
o-datepicker
component used to have a prop namededitable
, which as its name suggested, allowed for the inline editing of the date. Now, in the latest version of oruga for vue 3, that prop is gone, and the only prop that resembles that isreadonly
, which acts as the nativereadonly
attribute.Steps to reproduce
I created a sandbox reproducing the issue.
Expected behavior
When the date is inline edited, if the text is a valid date, it should be set as the date.
Actual behavior
The date is either not changed or emptied.
The text was updated successfully, but these errors were encountered: