Change event should have any passed argument wrapped in event type key
See original GitHub issueAt the time being any passed arguments to the change event is printed in double which makes it difficult to use the arguments for any custom actions, potentially making api call, just like having the added/removed keys when logging any passed arguments making it pointless. Is it possible to do so ?
update(event, argument) {
console.log(event); => this print {added: {}} and {removed: {}}
//console.log(argument.id) => this prints (1) and (2)
}
so you can access the event.added and the event.removed
Maybe we can get something like
update(event, group) {
console.log(event); // {addedTo: {group}} and {removedFrom: {group}}
}
You can see this closed issue as well #336
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Vue draggable Change event should have any passed ...
Vue draggable Change event should have any passed argument wrapped in event type key. Hey guys, I've been trying use this Vue.Draggable package...
Read more >Argument of type 'Event' is not assignable to parameter ...
Temporary solution if you want to leave strict template type checking enabled is to wrap $event in $any(). Example: $any($event). it should work...
Read more >Passing Event Object and Other arguments to Callback ...
Suppose I want to pass the event object along with other parameters to the callback function in the addEventLististener as shown below, ...
Read more >EventTarget.addEventListener() - Web APIs | MDN
A boolean value indicating whether events of this type will be dispatched to the registered listener before being dispatched to any EventTarget ...
Read more >Dispatching custom events
let event = new Event(type[, options]);. Arguments: type – event type, a string like "click" or our own like ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well as it turned out, I used a different approach at the end which is in a first time use the add event to get the added to group then to get the dragged item using event.added
All I wanted at the end was some way to get all these values without using two events.
and again regarding you answer to the second question ?
no from the start that’s not what I mean, when I console.log the group in the change event, it returns two groups objects. The group which the story was removed from and the group which the the story was added to. The issue is that these groups do not have a “key” to access one of them. this is the issue I’ve been trying to tell from the start.
@minedun6 , This is a question on how use vue.draggable not a feature request nor a bug description, so it should go to stackoverflow. Besides that it is very difficult to understand what you try to achieve from your description. Where is the step by step scenario, where is the expected vs actual?
I make some correction on your fiddle (uncorrect use of v-model, v-for element not keyed…): https://jsfiddle.net/dede89/025fausd/ On change is called once on the component where the component is removed and once on the component where the element is added. This is normal.