Skip to content

id property of Typeahead is not propagated to input #668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
allancaffee opened this issue Sep 6, 2021 · 1 comment
Closed

id property of Typeahead is not propagated to input #668

allancaffee opened this issue Sep 6, 2021 · 1 comment

Comments

@allancaffee
Copy link

Hey. I'm not sure whether this is legitimately a bug, or if I'm misunderstanding how to use the id field.

Version

^5.1.4

Steps to reproduce

The id attribute to <Typeahead> appears not to be passed down the rendered <input>. This can be reproduced with the basic example

        <Typeahead
          id="basic-typeahead-single"
          labelKey="name"
          onChange={setSingleSelections}
          options={options}
          placeholder="Choose a state..."
          selected={singleSelections}
        />

It's also visible if you inspect element the examples on https://ericgio.github.io/react-bootstrap-typeahead/

Expected Behavior

I'd expect the id attribute to show up on the input element so that screen readers and other JS code can find it. In my case I'm trying to use the <Typeahead> with Formik's handleBlur handler so that Formik knows that the field has been touched, but since the ID isn't present on the relevant input Formik isn't able to tell which field has changed.

Actual Behavior

The id field doesn't show up at all on the <input> element. It appears that the aria-owns field does get populated with the ID that gets passed in.

@ericgio
Copy link
Owner

ericgio commented Sep 7, 2021

Duplicate of #662, #629, #563 and others.

@ericgio ericgio closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants