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

Vue3 compatible version no longer exports activate and deactivate methods #374

Closed
DV8FromTheWorld opened this issue Jun 29, 2021 · 3 comments · Fixed by #375
Closed

Vue3 compatible version no longer exports activate and deactivate methods #374

DV8FromTheWorld opened this issue Jun 29, 2021 · 3 comments · Fixed by #375

Comments

@DV8FromTheWorld
Copy link
Collaborator

In the Vue2 version (1.x) the following was valid:

<template>
  <FocusTrap ref="focusTrap">
    <!-- Content here -->
  </FocusTrap>
</template>

<script>
export default {
  methods: {
    manuallyDeactivate() {
      this.$refs.focusTrap.deactivate()
    }
  }
} 
</script>

The activate and deactivate methods were exposed on the component. The documentation speaks to their usage as well.

This is no longer possible in the Vue3 (2.x / 3.x) version as the methods are not being exposed on the component.

@posva
Copy link
Owner

posva commented Jun 29, 2021

You might need to do this.$refs.focusTrap.proxy.deactivate()

@DV8FromTheWorld
Copy link
Collaborator Author

Gave that a shot but it didn't work.

@posva
Copy link
Owner

posva commented Jun 29, 2021

Ah right, we need vuejs/rfcs#210

DV8FromTheWorld added a commit to DV8FromTheWorld/focus-trap-vue that referenced this issue Jun 29, 2021
@posva posva linked a pull request Jun 29, 2021 that will close this issue
11 tasks
@posva posva closed this as completed Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants