Skip to content

Custom trigger button #1029

Answered by dhayab
vnugent asked this question in Q&A
Oct 2, 2022 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Hi, you can use the setIsOpen() state setter, returned by autocomplete(), to programmaticaly open the detached panel. For this to work correctly you'll also need to configure autocomplete with openOnFocus: true.

const { setIsOpen } = autocomplete({
  // ...
  openOnFocus: true,
});

/* ... */

tagBtn.addEventListener('click', () => {
  setIsOpen(true);
});

Replies: 2 comments 3 replies

Comment options

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

You must be logged in to vote
3 replies
@dhayab
Comment options

@vnugent
Comment options

@solace
Comment options

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