Quantcast

filteringSelect Value Changes with arrow keys

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

filteringSelect Value Changes with arrow keys

Nathan Friesen

I’ve found with the filteringSelect control, when you use the arrow keys on the keyboard to move to the item you want to select, each value you move to gets set as the value of the control. This also happens as you type into the control, where each time the first value in the list changes the value of the control is set.

 

For example, if you have a list of states and want to select Arizona you could start typing ‘A’, which would select Alabama and set the value of your control. Then if you use the arrow keys to move down to Arizona the control would change values for each state you pass through. I have a JS Fiddle set up at https://jsfiddle.net/nathanF/15b3wLe8/ that shows each time the value of the control changes.

 

Is there a way to not change the value of the control until the user does something to indicate the item they want to select, such as hitting Enter? We are triggering actions each time the value of the filteringSelect changes, and these frequently include calls back to the server and database. I would rather not make the users wait for a server call to return for items they’re just stepping through to get to the value they want.

 

I am also working on intercepting the value change and asking the user if they really want to make the change before committing it and triggering other changes on the page. If they don’t want to make the change I would like to be able to abort the change and leave the control on the last selected value.  I would like to be able to allow the user to arrow through the values in the list and only ask them about changing to their final value.

 

Any help or suggestions would be greatly appreciated.

 

Thanks

 

Nathan


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: filteringSelect Value Changes with arrow keys

gumbawumba
just a suggestions...
don't (do it) on the watch value.  
Instead (do it) after onBlur.

and/or

You could look for enter also.  I usually have a bunch of fields and look for enter it submit forms!

Here is a modified fiddle showing doing something on enter.
https://jsfiddle.net/gumbawumba/Lv4Lxd18/



Loading...