Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events dragstop and resizestop are not triggering. #400

Closed
kardeepak77 opened this issue Jan 28, 2024 · 8 comments
Closed

Events dragstop and resizestop are not triggering. #400

kardeepak77 opened this issue Jan 28, 2024 · 8 comments

Comments

@kardeepak77
Copy link

I am using latest bits.
Events dragstop and resizestop are not triggering.
@dragstop="console.log('Drag Stop')"
@resizestop="console.log('Resize Stop')"

Events dragging and resizing eventsare working fine.

@dragging="console.log('Dragging)"
@resizing="console.log('Resizing')"

@HLN177
Copy link

HLN177 commented Jan 29, 2024

In the codebase, the events emitted are "dragStop" and "resizeStop", and Vue provide an automatic case transformation for event names.

So try:
@drag-stop="console.log('Drag Stop')"
@resize-stop="console.log('Resize Stop')"

@HarryWuuuu
Copy link

I am curious why it worked in Vue2, Vue3 seems stricter than Vue2.

@HLN177
Copy link

HLN177 commented Jan 30, 2024

Event in Vue2:
image

Event in Vue3:
image

It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

@kardeepak77
Copy link
Author

Thank you @drag-stop and @resize-stop worked!

@kardeepak77
Copy link
Author

Closing issue.
To catch drag stop and resize stop event use following -
@drag-stop="console.log('Drag Stop')"
@resize-stop="console.log('Resize Stop')"

@HarryWuuuu
Copy link

HarryWuuuu commented Jan 31, 2024

Event in Vue2: image

Event in Vue3: image

It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

Actually, I still don't understand.
As the documentation illustrated, v-on:dragStop will become v-on:dragstop in Vue2 because DOM template automatically transforms it to lowercase. So, the @dragstop shouldn't work in Vue2 as Vue-Draggable-Resizable emits dragStop event which is camel case and dragstop doesn't match dragStop. However it actually works ok in Vue2.
How to explain this one?

@HLN177
Copy link

HLN177 commented Jan 31, 2024

Event in Vue2: image
Event in Vue3: image
It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

Actually, I still don't understand. As the documentation illustrated, v-on:dragStop will become v-on:dragstop in Vue2 because DOM template automatically transforms it to lowercase. So, the @dragstop shouldn't work in Vue2 as Vue-Draggable-Resizable emits dragStop event which is camel case and dragstop doesn't match dragStop. However it actually works ok in Vue2. How to explain this one?

You are right and I am sure you understand the Vue2 case transformation very well.

Coz I have took a look into the commit history and found these two small changed.

On 03/01/2024
image

On 16/04/2023
image

So before 16/04/2023, @dragstop worked fine all the way. : )

@HarryWuuuu
Copy link

Event in Vue2: image
Event in Vue3: image
It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

Actually, I still don't understand. As the documentation illustrated, v-on:dragStop will become v-on:dragstop in Vue2 because DOM template automatically transforms it to lowercase. So, the @dragstop shouldn't work in Vue2 as Vue-Draggable-Resizable emits dragStop event which is camel case and dragstop doesn't match dragStop. However it actually works ok in Vue2. How to explain this one?

You are right and I am sure you understand the Vue2 case transformation very well.

Coz I have took a look into the commit history and found these two small changed.

On 03/01/2024 image

On 16/04/2023 image

So before 16/04/2023, @dragstop worked fine all the way. : )

Not only in vue-draggable-resizable, in Vue2, any custom event with camel case name can be listened with camel case listener correctly. Not as that illustrated in Vue2 Doc. So wired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants