I'm trying to set the focus on the people picker input once it is rendered, however, I cannot use any dom query selectors etc as it doesn't really exist at the right time.
There is no tabindex value that works and the input is severla children deep in the rendered
{this.state.mentionStatus ? (
<div className={styles.mentionSearchBox}>
<PeoplePicker
selectionChanged={this.addPerson}
placeholder="Select person."
showMax={10}
id="FocusOnMe"
type={PersonType.any}
></PeoplePicker>
</div>
) : (
<div></div>
)}
The rendered code as follows:
<mgt-people-picker id="FocusOnMe" tabindex="2" autofocus="">
<div dir="ltr" class="people-picker">
<div class="selected-list">
<mgt-flyout light-dismiss="" class="flyout">
<div class="search-box">
<input id="people-picker-input" class="search-box__input" type="text" label="people-picker-input" aria-label="people-picker-input" role="input" placeholder="Select person.">
</div>
<div slot="flyout" class="flyout-root">
</div>
</mgt-flyout>
</div>
</div>
</mgt-people-picker>
Does anyone know of any method to allow the user to just start typing without having to click into it?