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

Allow for static id in Popover.vue #379

Closed
geoffreyrichey opened this issue Oct 23, 2019 · 1 comment
Closed

Allow for static id in Popover.vue #379

geoffreyrichey opened this issue Oct 23, 2019 · 1 comment

Comments

@geoffreyrichey
Copy link

geoffreyrichey commented Oct 23, 2019

The aria-descibedby of the component id generated randomly from the id data prop and breaking my snapshot tests as it is different each time I run tests.

Referenced code:

data () {
    return {
      isOpen: false,
      id: Math.random().toString(36).substr(2, 10),
    }
  }

Causing an output like this:

 <div aria-describedby="popover_59co7n20s7" class="trigger" style="display: inline-block;">...</div>

Would be great to allow for id to be optionally passed as a prop with a fallback to the random string.

<v-popover trigger="manual" :open="isOpen" :id="'my-comp-id'">...

Resulting in:
<div aria-describedby="popover_my-comp-id" ... > ... </div>

@geoffreyrichey
Copy link
Author

Thanks!

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

Successfully merging a pull request may close this issue.

1 participant