algolia / algolia/instantsearch

"A form field element has neither an id nor a name attribute"

Open
#6,345 3 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
4.1k
Forks
553
Avg merge
1d 11h
Merged PRs (30d)
51

Description

### 🐛 Current behavior

Getting this client-side warning, hundreds of times:

"A form field element has neither an id nor a name attribute. This might prevent the browser from correctly autofilling the form.
To fix this issue, add a unique id or name attribute to a form field. This is not strictly needed, but still recommended even if you have an autocomplete attribute on the same element."

### 🔍 Steps to reproduce

React InstantSearch... tried adding an "id" and "name"" attribute to SearchBox, for example, but it does not pass it as an HTML attribute to the "input" node.

### Live reproduction

none

### 💭 Expected behavior

Both id and name attributes should be passed from the SearchBox and RefinementList elements to the actually rendered node. Or, add some automatically.

### Package version

react-instantsearch latest

### Operating system

macOS 14.6.1

### Browser

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by tracing how props are forwarded in the React InstantSearch SearchBox and RefinementList components to the rendered form fields. Verify whether supplied id and name values reach the actual input or refinement elements, and consider the issue complete when the attributes are forwarded or generated as expected and the existing component tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.