Skip to content

Accessible id is not being applied correctly, cannot access element via label text #848

Closed
@sethreidnz

Description

@sethreidnz

Version

6.3.2

Steps to reproduce

I have created a reproduction repo with unit test to show the desired behaviour not passing:

https://github.com/sethreidnz/react-bootstrap-typeahead-id-not-working

Expected Behavior

I would expect if I do something like this:

<label htmlFor="typeahead">Typeahead</label>
<Typeahead id="typeahead" options={["one", "two", "three"]} isLoading={false} />

Or:

<label htmlFor="async-typeahead">Async Typeahead</label>
<AsyncTypeahead id="async-typeahead" options={["one", "two", "three"]} isLoading={false} onSearch={function (query: string): void {
  console.log(query)
} } />

That the input would have the id property applied and would be available via the label text.

Actual Behavior

The input does not have the id attribute and it is not available via the label text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions