react-component / react-component/mentions

Pressing enter on not found causes a javascript error

Open
#16 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
112
Forks
65
Avg merge
28m
Merged PRs (30d)
2

Description

  1. Go to https://react-component.github.io/mentions/?selectedKind=rc-mentions&selectedStory=dynamic&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Fsource%2Fpanel
  2. Type @dfadfdfadfdfadfdfdsfasd (or any string that won’t be found)
  3. Wait until it says Not Found
  4. Press enter

Initially it looks like https://github.com/react-component/mentions/blob/master/src/Mentions.tsx should check for a valid option
} else if (which === KeyCode.ENTER) { // Measure hit const option = this.getOptions()[activeIndex]; this.selectOption(option); event.preventDefault(); }

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the failure using the linked Mentions Storybook URL with a search string that returns Not Found, then inspect the Enter-key handling in src/Mentions.tsx. Confirm the fix by pressing Enter after no option is available and verifying that no JavaScript error occurs.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.