File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
services/static-webserver/client/source/class/osparc/ui/form Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,10 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
129129 this . fireDataEvent ( "changeValue" , value ) ;
130130 } ,
131131
132+ validate : function ( ) {
133+ return this . isValidNumber ( ) ;
134+ } ,
135+
132136 isValidNumber : function ( ) {
133137 return this . __phoneInput ? this . __phoneInput . isValidNumber ( ) : false ;
134138 } ,
@@ -223,6 +227,14 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
223227 preferredCountries : [ ] ,
224228 dropdownContainer : document . body ,
225229 } ) ;
230+
231+ // Trigger validation on input and blur
232+ domElement . addEventListener ( "input" , ( ) => {
233+ this . verifyPhoneNumber ( ) ;
234+ this . _applyValue ( this . getValue ( ) ) ; // keep qooxdoo form property in sync
235+ } ) ;
236+ domElement . addEventListener ( "blur" , ( ) => this . verifyPhoneNumber ( ) ) ;
237+
226238 this . __updateStyle ( ) ;
227239 }
228240 }
You can’t perform that action at this time.
0 commit comments