Closed sureshjoshi closed 6 years ago
That's because the list_item component doesn't implement click event on it. So you have to use native
modifier to add native event on the component. And when you click selectionTarget element, the event popup, so the click event on the list_item component will trigger. And you can use stop
or self
modifier to restrict the event.
I think it's an issue, I will take some time to fix this. Thanks for your comment.
I noticed a problem with the toggle handler in the ListItem - right now, if you want to click the ListItem and have it do something, while still allowing the item to be selectable (without the ListItem click handler running too) - I don't think it's possible to do that.
I think the ListItem's isSelectable toggle handler should have some modifier on it (not sure which). I've tried
@click.self
and@click.stop
and both of those seem to work - but I'm not super familiar with the modifiers.Here is some code that I've implemented which works (item is selectable when clicking explicitly on the checkbox, clicking the main item navigates, and clicking an icon does something else).
And in ListItem.vue
<div v-if='isSelectable' @click.stop='toggle' class='ms-ListItem-selectionTarget'></div>