Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Space at the end of item causes incorrect dropdown result #7655

Closed
simondevries opened this issue Mar 21, 2016 · 1 comment
Closed

Space at the end of item causes incorrect dropdown result #7655

simondevries opened this issue Mar 21, 2016 · 1 comment
Assignees
Labels
has: Pull Request A PR has been created to address this issue P1: urgent Urgent issues that should be addressed in the next minor or patch release.
Milestone

Comments

@simondevries
Copy link

This issue occurs when the auto complete is bound to a list of items and one of the records contains a space character at the end. If the user selects the item with the space and presses the 'X' button to clear the autocomplete, the dropdown will only show that one item rather than loading the whole list of items.

I used the Angular material code from their demo illustrate my point, with the only modification being the addition of a space to the end of 'Alabama ' See http://codepen.io/simondevries/pen/BKWwYM

  1. Type 'Alabama ' into the autocomplete,
  2. Press the 'X' button
    and then you will notice only one item is displayed when all should be displayed.
@topherfangio topherfangio self-assigned this Mar 24, 2016
@topherfangio topherfangio added the P1: urgent Urgent issues that should be addressed in the next minor or patch release. label Mar 24, 2016
@topherfangio
Copy link
Contributor

Confirmed, and nice catch 😄

@ThomasBurleson ThomasBurleson modified the milestone: Backlog Apr 20, 2016
@ThomasBurleson ThomasBurleson modified the milestones: - Backlog, Deprecated May 26, 2016
@topherfangio topherfangio added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label May 27, 2016
@topherfangio topherfangio modified the milestones: 1.1.0, Deprecated May 27, 2016
topherfangio added a commit to profoundry-us/material that referenced this issue May 27, 2016
If an autocomplete's item had spaces at the end, it would cause the
autocomplete to show only the selected option when attempting to
clear the value.

This was caused because the `oninput` event that we fire was somehow
resetting the value in the scope (after we had cleared it). Fix by
resetting the scope back to an empty value after we fire the `oninput`
event.

Additionally, fix a few issues in the Virtual Repeat that was affecting
the autocomplete and some test descriptions:

- Add unwatcher in Virtual Repeat to fix angular#8178.
- Use cached values in `$mdUtil.waitTransitionEnd()` to speed up performance
  and fix sizing issue in Virtual Repeat affecting the autocomplete.
- Fix a few descriptions in the tests to be shorter/clearer and fix typos.

Fixes angular#7655. Fixes angular#8178.
topherfangio added a commit to profoundry-us/material that referenced this issue May 28, 2016
If an autocomplete's item had spaces at the end, it would cause the
autocomplete to show only the selected option when attempting to
clear the value.

This was caused because the `oninput` event that we fire was somehow
resetting the value in the scope (after we had cleared it). Fix by
resetting the scope back to an empty value after we fire the `oninput`
event.

Additionally, fix a few issues in the Virtual Repeat that was affecting
the autocomplete and some test descriptions:

- Add unwatcher in Virtual Repeat to fix angular#8178.
- Use cached values in `$mdUtil.waitTransitionEnd()` to speed up performance
  and fix sizing issue in Virtual Repeat affecting the autocomplete.
- Fix a few descriptions in the tests to be shorter/clearer and fix typos.

Fixes angular#7655. Fixes angular#8178.
@topherfangio topherfangio added has: Pull Request A PR has been created to address this issue and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels May 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P1: urgent Urgent issues that should be addressed in the next minor or patch release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants