Skip to content

Allow for static id in Popover.vue #379

@geoffreyrichey

Description

@geoffreyrichey

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions