Skip to content

Dialog: Fixed Button to Toggle Dialog Open/Close #1919

Answered by hjaber
hjaber asked this question in Help
Discussion options

You must be logged in to vote

I ultimately switched to Popover from Dialog and exposed the close prop. The popover button remains fixed and you are able to add an overlay if necessary. It seems to be the solution I was looking for.

<Popover>
      <Popover.Button>Terms</Popover.Button>
      <Popover.Panel>
        {({ close }) => (
          <div
            onClick={async () =>close()}}
          >
           <a href="/">home</a>
          </div>
        )}
      </Popover.Panel>
    </Popover>
  )
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hjaber
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants