madarche / v-radio-deselectable

A Vuetify radio component that can be deselected
2 stars 1 forks source link

Error and not deselectable #2

Open Sjoerd82 opened 4 years ago

Sjoerd82 commented 4 years ago

Implemented like in the demo:

    <v-radio-group v-model="model">
      <v-radio-deselectable
        v-for="n in 3"
        v-bind:label="`Label ${n}`"
        v-bind:key="n"
        v-bind:value="n"/>
    </v-radio-group>

Where model = {}, gives me in Vuetify 2.2.12 errors:

[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'value' of undefined"

found in

---> at node_modules/v-radio-deselectable/src/component.vue

at src/components/Child.vue at src/views/Parent.vue at src/App.vue And: vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property 'value' of undefined at VueComponent.reset (component.js?297c:6) at mouseup (eval at ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"49e019a5-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/v-radio-deselectable/src/component.vue?vue&type=template&id=6c8b3a6a& (app.js:1267), :16:24) at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854) at HTMLDivElement.invoker (vue.runtime.esm.js?2b0e:2179) at HTMLDivElement.original._wrapper (vue.runtime.esm.js?2b0e:6911)
ghost commented 3 years ago

I am in the same situation. Currently this component is not available.

madarche commented 3 years ago

I'm sorry I've got no time to investigate but I just let you know that I'm still using this component and that it's still working for me with vuetify@1.5.x and vue@2.5.x. As specified here https://github.com/madarche/v-radio-deselectable/blob/master/package.json#L26 it has been developed for Vuetify 1.x. I would be glad to have people contributing a patch to make it work with a newer Vuetify or with different versions of Vuetify, depending on the maintainability and legibility of the code.