Doesn't mark the first item when the selected item is cleared by backspace
See original GitHub issueDescribe the bug
The scenario is when the [clearOnBackspace]="true" [markFirst]="true"
attributes are enabled.
So when I clear the value using backspace, it behaves as expected. Which is, it clears the input field and mark the first attribute in the dropdown.
Now, I select a value from the dropdown below and focus out from the input field. Then I click on the input field and clear the selected item using backspace, it doesn’t mark the first one
Reproducible example Stackbiltz Example which reproduces described behavior
To Reproduce Steps to reproduce the behavior (if the example is not provided):
- Go to the given example
- Click on the select dropdown
- Scroll down and select a value
- Focus out from the select input field
- Again focus on the select input field
- clear the selected item using backspace
- Can observe the issue the first item is not marked but the previously selected item
Expected behavior On the 7th step, mark the first item in the dropdown
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser - chrome, firefox, edge
- Version - 73.0.3683.86 (Official Build) (64-bit), 66.0.2 (64-bit), 44.17763.1.0 respectively
Smartphone (please complete the following information):
- Didn’t test
Additional context The expected behavior happens when the selected item is cleared using the clear/close icon though
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top GitHub Comments
This should work:
the intention of
[markFirst]
was to continue from last selection/first item when opening the dropdown. While dropdown is opened marked item stays in the same position. This is by design and otherwise, the user will get unexpected scrolls which will result in bad UX.