You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my html is div > input[type=checkbox]
when div with v-on:click, I found that the input element can not be selected.
What is Expected?
when click this input checkbox, checkbox should be selected or canceled.
div click event will trigger.
What is actually happening?
I have not read the source code,But I think div capture this click event and should not stop this event immediate, it kinda like use “event.stopImmediatePropagation” stop the event progagation?
changed the title [-]checkbox can not be selected if it's in a node with @click listener?[/-][+]checkbox can not be selected if it's in a element with @click listener?[/+]on Dec 20, 2016
@LinusBorg Okey first I met this bug when I am using vue 2.0.3,and I try to update vue to the lastest version. this bug still exsit, so ... version should be 2.x
Seems fixing this bug created a new bug for :checked="" binding when using in combination with vuex states for maintaining checkbox states.
<template><ul><liv-for="option in visibleOptions" :key="option.value"><inputtype="checkbox"
:name="filter.key"
:value="option.value"
:checked="inArray(option.value, filter.active)"
@change="updateFilter"></li></ul></template>
In this code example is :checked set to true or false whenever it's in the active filter array.
It seems when this component is updated (via vuex) the :checked stated doesn't get's updated like in 2.1.6. In my application is the state managed almost totally by Vuex.
When selecting several checkboxes (like brands) and use your browser back button to fallback to previous states. (it's managed by the popstate event)
What is expected
The checkbox will go on or off depending on the previous action.
What is actually happening?
Everything get's correctly updated (value wise), except the checkbox isn't honored to update (checked true/false). It keeps in a previous state. When selecting multiple after eachother and navigating back and forward is looks like is off a beat and missing the last changed checkbox.
Activity
[-]checkbox can not be selected if it's in a node with @click listener?[/-][+]checkbox can not be selected if it's in a element with @click listener?[/+]Marshane commentedon Dec 20, 2016
qbaty commentedon Dec 20, 2016
@marshare I do not think you understand my problem。
Yunkou commentedon Dec 20, 2016
@qbaty
@click.self="add"
LinusBorg commentedon Dec 20, 2016
@qbaty Thanks for rteporting this, looks like a bug indeed!
I took the freedom to correct the Vue version in your OP, as you use 2.1.6, noch 2.0.3
qbaty commentedon Dec 20, 2016
@LinusBorg Okey first I met this bug when I am using vue 2.0.3,and I try to update vue to the lastest version. this bug still exsit, so ... version should be 2.x
FKobus commentedon Jan 12, 2017
Seems fixing this bug created a new bug for :checked="" binding when using in combination with vuex states for maintaining checkbox states.
In this code example is :checked set to true or false whenever it's in the active filter array.
It seems when this component is updated (via vuex) the :checked stated doesn't get's updated like in 2.1.6. In my application is the state managed almost totally by Vuex.
Vue.js version
2.1.7+
Reproduction Link
http://vroom.automotivated.nl/
Howto reproduce
When selecting several checkboxes (like brands) and use your browser back button to fallback to previous states. (it's managed by the popstate event)
What is expected
The checkbox will go on or off depending on the previous action.
What is actually happening?
Everything get's correctly updated (value wise), except the checkbox isn't honored to update (checked true/false). It keeps in a previous state. When selecting multiple after eachother and navigating back and forward is looks like is off a beat and missing the last changed checkbox.
Code that goes with it:
https://github.com/Automotivated/vroom/blob/master/src/views/elements/filters/Multiple.vue
While reading the docs in Vuex, it seems to be best practise to do it like I did.
When did it work
It worked like a charm in 2.1.6. Seems really that fixing this bug triggered this bug to be created.
LinusBorg commentedon Jan 12, 2017
@FKobus Please open a new issue instead of adding to the bottom of closed ones. Thanks!
fengjinlong commentedon Mar 13, 2019
干得漂亮