Skip to content

Commit fd71419

Browse files
committed
SVY-20863 Using a Format on a Field is causing Odd Behavior on New
1 parent b05b7d0 commit fd71419

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • projects/bootstrapcomponents/src/textbox

projects/bootstrapcomponents/src/textbox/textbox.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,16 @@ export class ServoyBootstrapTextbox extends ServoyBootstrapBasefield<HTMLInputEl
109109
const types = ['date', 'time', 'datetime-local', 'month', 'week'];
110110
return types.includes(this.inputType);
111111
}
112+
113+
requestFocus(mustExecuteOnFocusGainedMethod: boolean) {
114+
if (this.format && this.format.isMask && this.dataProviderID != (this.getFocusElement() as HTMLInputElement).value) {
115+
// wait for ui value to be updated before focus, otherwise mask library will be initialized with the old value and not work properly
116+
setTimeout(() => {
117+
super.requestFocus(mustExecuteOnFocusGainedMethod);
118+
});
119+
}
120+
else {
121+
super.requestFocus(mustExecuteOnFocusGainedMethod);
122+
}
123+
}
112124
}

0 commit comments

Comments
 (0)