Skip to content

Expose domElement in options #26

@IlyaSemenov

Description

@IlyaSemenov

I would like to be able to access the original domElement that the handler has been attached to inside gesture callbacks.

The use case would be (simplified code):

<script setup>
// Quick drag-to-scroll implementation
function handleDrag({ domElement, delta: [x, y] }) {
  domElement.scrollBy(-x, -y)
}
</script>

<template>
  <div v-drag="handleDrag">
    <div>child</div>
    <div>child</div>
  </div>
</template>

I realize I can work around this with an additional ref or even with a custom directive (as I did), my point here being reducing boilerplate for simpler ad-hoc code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions