mapbox / mapbox/mr-ui

Form component should have a disabled prop, which disables submission even with the Enter key

Open
#102 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug jira-sync-complete
Dominant language
TypeScript
Stars
90
Forks
5
PR merge metrics
No merged PRs in 30d

Description

We recently had a bug where we disabled the `FormSubmit` component (using its `disabled` prop), but the `Form` could still be submitted with the Enter key. To avoid this situation, there should be a `disabled` prop on the `Form` component, which we could have set to `true`.

(In the meantime, the workaround is to do nothing in the `handleFormData` callback when the form *should* be disabled.)

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 at the Form component and trace how submission is handled when the Enter key is pressed. Add the requested disabled behavior so a disabled Form cannot submit through that path, and verify that the existing FormSubmit behavior remains consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.