ProtonMail / ProtonMail/WebClients
Avoid refocusing an already-focused Rooster editor on click
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 715
- PR merge metrics
- No merged PRs in 30d
Description
useInitRooster currently calls editor.focus() for every Rooster wrapper click, including when the editor already has focus.
Wrapper clicks should call editor.focus() only when editor.hasFocus() is false. The onFocus callback should still run for every wrapper click.
A focused red/green test confirms that the already-focused case fails before this change and that both the focused and unfocused cases pass with it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at useInitRooster and run the focused red/green test described in the issue. Verify that wrapper clicks focus the editor only when editor.hasFocus() is false, while onFocus still runs for every click; done means both focused and unfocused cases pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100