Skip to content
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

htmlFor Select #38

Open
halocline opened this issue Oct 18, 2022 · 1 comment
Open

htmlFor Select #38

halocline opened this issue Oct 18, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@halocline
Copy link
Collaborator

Please describe what the rule should do:

Grommet's Select component appends an "__input" to the input's id. This is not obvious to developers and causes form field labels to reference the input incorrectly.

What category of rule is this? (place an "X" next to just one item)

[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

Incorrect:

<FormField
        htmlFor="region"
        name="region"
        label="Region"
        help="Available regions are dependent on selected instance type(s)"
        required
      >
        <Select id="region" name="region" options={regionOptions} />
      </FormField>

Correct:

<FormField
        htmlFor="region__input"
        name="region"
        label="Region"
        help="Available regions are dependent on selected instance type(s)"
        required
      >
        <Select id="region" name="region" options={regionOptions} />
      </FormField>

Why should this rule be included in eslint-plugin-grommet?

@halocline halocline added the enhancement New feature or request label Oct 18, 2022
@ericsoderberghp
Copy link
Collaborator

Hmm... This feels we are asking the caller to understand something about Select that should be opaque to them. I'd like to discuss this a bit more.

@halocline halocline added the help wanted Extra attention is needed label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants