coreui/coreui-vue

CMultiSelect - If user click on X to remove and CMultiSelect is inside <form />, page is submitted

matgenois opened this issue · 6 comments

Hi! And thank you for looking at my issue.
Has title mention, I have this weird issue where if the CMultiSelect is inside a

, the submit happens. I went in the html and it seems like the x button is missing type='button' since the default value of type is 'submit' :
image
image
If I add the type='button' manually on the button in the browser inspector, it works fine.

<template>          
  <CContainer fluid class="step-container py-2">
    <!-- no issue here -->
    <CFormMultiSelect id="customId"
        label="custom label"
        :options="getOptions()"
        v-model="customModel" />
    <form>
      <!-- issue here -->
      <CFormMultiSelect id="customId2"
        label="custom label 2"
        :options="getOptions()"
        v-model="customModel" />

@matgenois which version of @coreui/vue-pro do you use?

Bug is in 5.0.1 and 5.1.0

@matgenois ok, I'm working on it.

@matgenois fixed in v5.2.0

Thank you!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions