Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Select Value Does not update when typing a second char #6652

Closed
MissingHandle opened this issue Mar 11, 2014 · 7 comments
Closed

Select Value Does not update when typing a second char #6652

MissingHandle opened this issue Mar 11, 2014 · 7 comments

Comments

@MissingHandle
Copy link

When I focus on a text field, then tab over to a select field, then type the value of a valid option which starts with the same letter as another option that comes alphabetically first, I expect that angular will record the value of the option i typed, and which is also displayed in the UI. Instead, the angular value is the non-typed option which comes first alphabetically.

Fiddle: http://jsfiddle.net/Missinghandle/vFX9n/

Select the text box
Tab
type "i", "l"
UI shows IL
select value is ID

@caitp
Copy link
Contributor

caitp commented Mar 11, 2014

There are a few problems with this:

  1. the value of your select options are objects, this isn't going to work the way you expect

  2. you don't have an ng-model for the input element, so no model update ever happens when typing into it.

I've fixed it up for you at http://jsfiddle.net/cLRds/.

Questions like this are much better suited for the irc channel, mailing list or stackoverflow, though.

@caitp caitp closed this as completed Mar 11, 2014
@MissingHandle
Copy link
Author

Thanks for replying. On (2), you misunderstand the purpose of the input element in my example. I don't care about its value - I care about being able to tab over into the select box, and it's the value of the select box that I care about.

Anyway, the same issue that I point out in my original post/fiddle happens in your fiddle as well:

  1. Focus on the text box.
  2. Hit 'Tab' so that you are now on the select box.
  3. Type 'I' followed by "L" (lowercase is fine, caps is for clarity of the L)
    You will see that the UI shows a value of IL in the select box, but the value captured in the model is "ID" (ostensibly, in this example, for Idaho).

And this wasn't a question, it was a bug report :).

@caitp
Copy link
Contributor

caitp commented Mar 12, 2014

@MissingHandle oh, I see what you're saying, that was not explained very clearly at all.

So, if the browser is emitting events for those, then we can fix this, but if not, there isn't much we can do about it. I'll reopen for now, though.

@caitp caitp reopened this Mar 12, 2014
@MissingHandle
Copy link
Author

Thanks. I updated the fiddle with extra documentation:

http://jsfiddle.net/Missinghandle/vFX9n/2/

@lefos987 lefos987 self-assigned this Mar 12, 2014
@lefos987 lefos987 added this to the Backlog milestone Mar 12, 2014
@lefos987 lefos987 removed their assignment Mar 12, 2014
@nvreynolds
Copy link

Along with your repro steps this screenshot shows what is going on: screen shot 2014-03-12 at 16 27 09

Top value in list is actually selected when entering desired value to be selected by typing the value name and pressing enter key.

@MissingHandle
Copy link
Author

Worth fixing, don't you think? @caitp ?

@btford btford removed the gh: issue label Aug 20, 2014
@Narretz
Copy link
Contributor

Narretz commented Sep 28, 2015

this is the same as #9134

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

No branches or pull requests

6 participants