JosephusPaye / Keen-UI

A lightweight Vue.js UI library with a simple API, inspired by Google's Material Design.

Home Page:https://josephuspaye.github.io/Keen-UI/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bshifrin opened this issue · comments

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.

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)"

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