-
26 Nov 2012 6:47 AM #1
ComboBox select event not fired when leaving field using mouse click
ComboBox select event not fired when leaving field using mouse click
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.2
- Firefox (latest w/ Firebug)
- Chrome (latest)
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- If you have a ComboBox with a 'select' event attached, the event will be triggered if you type in a value and tab off the field. If you type in a value and use the mouse to select another field (or just click off the field), the select event will not be fired.
- Open the example provided
- Type in "Alaska" into the combo box field and tab off the field
- Notice the message box showing the event has fired
- Now type "Alabama" into the dropdown and instead of tabbing off the field, click somewhere else on the screen with the mouse
- Notice the event is not fired. So it is possible to enter a valid value from the dropdown but have no way to trap that event if the user uses the mouse to move off the combo box
- The 'select' event should be fired
- No 'select' event is fired
HELPFUL INFORMATIONCode:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Combo Box Issue</title> <link rel="stylesheet" type="text/css" href="../extjs4/resources/css/ext-all.css" /> <script type="text/javascript" src="../extjs4/ext-debug.js"></script> <script type="text/javascript"> Ext.require('Ext.form.*'); Ext.onReady(function() { Ext.tip.QuickTipManager.init(); var states = Ext.create('Ext.data.Store', { fields: ['abbr', 'name'], data : [ {"abbr":"AL", "name":"Alabama"}, {"abbr":"AK", "name":"Alaska"}, {"abbr":"AZ", "name":"Arizona"}, {"abbr":"NC", "name":"North Carolina"}, {"abbr":"SC", "name":"South Carolina"} ] }); var form = Ext.createWidget('form', { renderTo: Ext.getBody(), title: 'Combo box test', bodyPadding: 5, frame: true, width: 340, fieldDefaults: { labelAlign: 'left', labelWidth: 105, anchor: '100%' }, items: [{ xtype: 'combo', fieldLabel: 'Combo Box:', name: 'cb1', forceSelection: true, displayField: 'name', valueField: 'abbr', store: states, queryMode: 'local' }, { xtype: 'textfield', fieldLabel: 'Text Field:', name: 'tf1' } ] }); var selectEvent = function() { alert('Event Fired'); } var combobox = form.down('combo'); combobox.on('select', selectEvent, this); }); </script> </head> <body> </body> </html>
Debugging already done:- I have stepped through code (including beforeBlur), but the events for firing 'select' seem to be tied only to clicking on a combo box item and a keyboard event for tabbing off the field.
- not provided
- Windows 7 Enterprise
-
26 Nov 2012 8:55 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,640
- Vote Rating
- 435
I cannot reproduce this issue with 4.1.3
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
26 Nov 2012 2:30 PM #3
Thanks for looking into it. We are two weeks from a release and 4.1.3 broke many things in our build when we tried to upgrade, so we can't do that yet. I'll try to do some source code compares to see what has changed and put in some overrides to fix the issue until we can move to 4.1.3.
-
27 Nov 2012 4:58 AM #4
I found the changes I needed to add overrides but actually discovered that the issue was only halfway fixed in 4.1.3. While the event does fire now, the combo box value is not being set for this scenario.
Change the selectEvent() function in the example to the following:
Notice that when choosing a value with the mouse, or typing in and tabbing off the field, the value shown will be the correct state code. When you type in the value and click off the field, the event does now fire; however, the state code is not being shown, it instead just shows the state name.Code:var selectEvent = function(field) { alert(field.getValue()); }
-
29 Nov 2012 5:11 AM #5
What are the steps to get this issue looked at again with the new information I provided?
-
20 Feb 2013 8:33 AM #6
Because no one followed up on this report, I had to submit this issue through our support subscription. Once support looked at it, they classified it as a bug and filed Jira EXTJSIV-8006 to get it fixed.
Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.


Reply With Quote