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

[Bug Report][3.1.6] v-navigation-drawer $refs[refName].$el does not return the Element #16766

Closed
MetRonnie opened this issue Feb 23, 2023 · 3 comments
Labels
S: triage upstream Problem with a third party library that we may have to work around

Comments

@MetRonnie
Copy link
Contributor

Environment

Vuetify Version: 3.1.6
Vue Version: 3.2.47
Browsers: Edge 110.0.1587.50
OS: Windows 10

Steps to reproduce

Set ref="<name>" attribute on a VNavigationDrawer, then access this.$refs[<name>].$el

Expected Behavior

The nav Element is returned

Actual Behavior

Some kind of object called #text is returned

Reproduction Link

https://play.vuetifyjs.com/#...

@carlosyan1807
Copy link

Vuetify Version: 3.3.12

same

@KaelWD
Copy link
Member

KaelWD commented Aug 11, 2023

https://vuejs.org/api/component-instance.html#el

For components with multiple root nodes, $el will be the placeholder DOM node that Vue uses to keep track of the component's position in the DOM

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2023
@KaelWD KaelWD added the upstream Problem with a third party library that we may have to work around label Aug 11, 2023
@MetRonnie
Copy link
Contributor Author

Shame that there's not much info about this in the Vue docs. I've come up with a couple of workarounds:

  1. Set the id attribute on the VNavigationDrawer and access the nav by document.getElementById()
  2. Use this.$refs.<name>.$el.nextElementSibling - see https://developer.mozilla.org/en-US/docs/Web/API/Element/nextElementSibling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: triage upstream Problem with a third party library that we may have to work around
Projects
None yet
Development

No branches or pull requests

3 participants