dojo / dojo/dijit

_SearchMixin/_AutoCompleteMixin fails to autocomplete value of "8"

Open
#185 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
172
Forks
180
PR merge metrics
No merged PRs in 30d

Description

I'm using a FilteringSelect with a set of predefined values `[{id:'1',label:'1-the value'},...,{id:'8',label:'8-lorem ipsum'}`
Autocomplete is turned on.
If the user types '1', the label autocompletes and when pressing TAB, the value is set.
BUT - when typing '8', the value is not autocompleted and the value needs to be selected manually.

after some debugging I tracked it down to `_SearchMixin._processInput()` - there the `/*boolean*/_prev_key_backspace `flag is being calculated.
when typing '8', the keycode is "8" - when comparing it with `dojo/keys.BACKSPACE` because of auto(un)boxing, "8" equals 8 - and therefore the autocomplete code in `_AutoCompleteMixin._openResultList()` gets skipped.

proposed solution: use === to compare the charOrCode with the key-constant.

Contributor guide

Open the contributing guide

Research direction

Start by reading `_SearchMixin._processInput()` and the comparison with `dojo/keys.BACKSPACE`, then trace how that flag controls `_AutoCompleteMixin._openResultList()`. Confirm the failure with a numeric input such as `8`; done means numeric values no longer take the backspace path and autocomplete behaves like the `1` case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.