I have a numberfield input that I want to lose when the user presses the enter key.
Here's the current configuration:
{ xtype: 'numberfield', minValue: 0, maxValue: 99999, hideTrigger: true, keyNavEnabled: false, mouseWheelEnabled: false, enableKeyEvents: true, listeners: { specialkey: function(f, e) { if (e.getKey() == e.ENTER) f.blur(); } } }
The specialkey handler works by calling blur() as expected, but the only result is that the caret disappears from the input (which indicates that the DOM text input element has been blurred). The field still has all the x-form-focus etc css classes, and examining the object shows that the private hasFocus property is still true.
Any suggestions?
I tried calling f.onBlur() explicitly after calling blur() , but that didn't matter.
(The btw field does not belong to the form, so there is no form to submit.)
source share