Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backspace is deleting everything #29

Open
kennethlarsen opened this issue Oct 11, 2016 · 9 comments
Open

Backspace is deleting everything #29

kennethlarsen opened this issue Oct 11, 2016 · 9 comments

Comments

@kennethlarsen
Copy link

There's an issue with {{aupac-typeahead}} where deleting a single character in the input removes the entire input value. This is very annoying for correcting typos.

This is happening when suggestions are objects (which we fetch from an api).

Basically it looks like this gets called when I press backspace
this.get('_typeahead').typeahead('val', '');
(line 79 in addon/components/aupac-typeahead.js)

@kennethlarsen
Copy link
Author

Basically doing some thing like:

//typeahead.js Customizations
allowCharacterDeletion: false, //@public

  setValue : function(selection) {
    selection = this.transformSelection(selection);
    if(selection) {
      this.get('_typeahead').typeahead('val', selection);
    } else if (!this.get('allowCharacterDeletion')){
      this.get('_typeahead').typeahead('val', '');
    }
  },

returns the expected behavior.

@jackmatt2
Copy link
Member

Maybe this should be the default behaviour.

@jackmatt2
Copy link
Member

This appears to be working for me. I am pretty sure this feature only works with Strings though.

@jackmatt2
Copy link
Member

Just tested with a ember-data model and it is working.

@jackmatt2 jackmatt2 mentioned this issue Dec 4, 2016
@jackmatt2
Copy link
Member

After some experimentation I can see this issue now. I have included it as part of a bigger cleanup issue.

@mnifakram
Copy link

Does this issue still valid? I can't reproduce it! If anyone can give a hint or twiddle on how to reproduce it. I will be happy to fix it.

@jackmatt2
Copy link
Member

@mnifakram yes, this should still be an unresolved bug.

@Charizard
Copy link

Happening for me in v3.0.0

@GCheung55
Copy link
Contributor

Happening in v3.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants