question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change event should have any passed argument wrapped in event type key

See original GitHub issue

At 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:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
minedun6commented, Jan 31, 2018

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 ?

I mean you already have it as parameter

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.

2reactions
David-Desmaisonscommented, Jan 30, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found