Skip to content
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

Click on calendar buttons (without type argument) triggers form submit event #559

Open
bshifrin opened this issue Jul 21, 2023 · 2 comments

Comments

@bshifrin
Copy link

bshifrin commented Jul 21, 2023

We have migrated from Keen UI 1.0.x to 1.4.0 and observe backward incompatible behavior: click on UiCalendar buttons (they currently don't have type argument) triggers form submit event. This is critical, because UiCalendar could be used as field widget which often rendered inside <form ...> tag. Click on a date should select date and not submit entire form.

@bshifrin
Copy link
Author

bshifrin commented Jul 21, 2023

I can't open PR, but it could be fixed this way:

diff --git a/src/UiCalendarWeek.vue b/src/UiCalendarWeek.vue
index 7f52706..0514173 100644
--- a/src/UiCalendarWeek.vue
+++ b/src/UiCalendarWeek.vue
@@ -2,6 +2,7 @@
   <tr class="ui-calendar-week" :class="classes">
     <td v-for="date in dates" :key="date.toString()">
       <button
+        type="button"
         class="ui-calendar-week__date"
         :class="getDateClasses(date)"
         :disabled="isDateDisabled(date)"

@bshifrin bshifrin reopened this Jul 21, 2023
@bshifrin
Copy link
Author

bshifrin commented Jul 21, 2023

For the same reason, I believe, default value of UiButton buttonType property should be reverted back to button. After upgrade we encountered many non-intentional form submit issues related to this backward incompatible change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant