Skip to content

How are you supposed to pass slot="title" to Heading for Dialog? #7521

Answered by evadecker
evadecker asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out, this was a silly misunderstanding, not a bug.

I just realized that all Popover components inherit from Dialog — the warnings were being thrown from Popover components I'm using, not from Modal components. Can mark this as solved!

Is there a recommended way to implement the title for Popover when you don't want it visibly shown? So far I'm doing this...

<Popover>
  <Dialog>
    <Heading slot="title" className="sr-only">{title}</Heading>
    {children}
  </Dialog>
</Popover>

...but not sure if there's a better approach. Might be nice to have an example in the docs, particularly for things like Popover and Select.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@evadecker
Comment options

@evadecker
Comment options

Answer selected by evadecker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants