mapbox / mapbox/mapbox-gl-geocoder

should not refocus after selecting result

Open
#368 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs discussion
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

please consider adding an option to disable this:

```
this._inputEl.focus();
this._inputEl.scrollLeft = 0;
this._inputEl.setSelectionRange(0, 0);
```

semi-related: imho, on focus, it should `this._inputEl.select()` - but not a big enough issue for me to make a github issue

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

Locate the result-selection code containing the shown focus, scrollLeft, and setSelectionRange calls. Read the surrounding control behavior and determine how an option would disable refocusing after a result is selected; done means that option preserves the user's focus without changing the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
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.