I have some problem using text validation on blur event.
I’m using this code snippet
{ view:"text", label:"String", name:"string", required:true, validate:webix.rules.isNotEmpty,
on:{
"onBlur":function(){
if(this.validate() === false){
this.define("invalidMessage", "Custom msg");
this.focus(); // Not working as aspected focus are not set to this "element"
}
}
},
}
onBlur event occurs at the moment when a browser is moving focus to some other target, so a browser can ignore the attempt to change focus target from this handler.
You can change code to the
webix.delay(this.focus, this);
It will call this.focus just after end of current event processing
Thanks i have other two questions regarding the ui.text component is it possible create and validate ui.text elment without concatenate them inside a form view?