PDA

View Full Version : [FIXED] validateOnBlur coded in Ext.util.Focusable



Greendrake
1 Sep 2015, 6:56 PM
This is technically not a bug but rather a programming flaw that bugs you. The implementation of onBlur (https://docs.sencha.com/extjs/6.0/6.0.0-classic/source/Focusable.html#Ext-util-Focusable-method-onBlur) method in Ext.util.Focusable contains the provision for validateOnBlur (https://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.form.field.Base-cfg-validateOnBlur) coded in. This provision relates to form fields only and has nothing to do with focusable things in general, therefore it should be moved where it belongs.

Why is this causing inconvenience?

I started implementing some custom validation logic, and there was a need to know whether or not the field had focus. Because the cited onBlur method negates the hasFocus flag only after calling validation on blur:
if (me.validateOnBlur) {
me.validate();
}
me.hasFocus = false;
...in my custom code, the field is still reported as focused.
See what I mean? Validation occurs on blur, but the field is still "focused"! Complete nonsense.

nohuhu
4 Sep 2015, 12:29 PM
Thanks for the report! I have opened a bug in our bug tracker.