luckyframework / luckyframework/avram

form input id collisions

Open
#1,001 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Crystal
Stars
183
Forks
67
PR merge metrics
No merged PRs in 30d

Description

When there are more forms on a single page, the `id` attributes is not unique for each label/input.
That is a problem for accessibility and usability, since now clicking the label may activate completely unrelated input.

One can work around this by manually setting the id for each tag for now, but it would be awesome if there was a way to do this automatically. Maybe generating a random prefix for each `form_for` instance?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the form_for implementation and the paths that render label and input id attributes. Reproduce a page with multiple forms and confirm the ids collide. Done means each form's labels target the intended inputs without requiring manually assigned ids.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
accessibility, frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.