Search code examples
reactjstypescriptblueprint

Open Select without click on child component


I'd like to know how can I open a Select from blueprint without using the click method on the child component used to render the select.

<UserSelect
    items={allUsers} popoverProps={{ minimal: false }}
    noResults={<MenuItem disabled={true} text='No results.' />}
    itemRenderer={renderUser}
    itemPredicate={filterUsers}
    onItemSelect={(item,ev)=>{onItemSelectHandler(item,ev);} }>
    <p ref={usersDropdownRef} > click me test</p>
</UserSelect>

Instead of using the click on the paragraph, I'd like to set a prop in UserSelect like isOpen = {myVar}, how can I achieve a similar solution if isOpen is not available via props?


Solution

  • To Control the underlying Popover with popoverProps={{ isOpen: true }}