fix crash when rendering and email UI field, fixes #9752

This commit is contained in:
Martin Raifer
2023-07-12 22:00:42 +02:00
parent 0781823b70
commit 396d142623
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -28,7 +28,11 @@ export function utilGetSetValue(selection, value, shouldUpdate) {
}
function stickyCursor(func) {
const supportedTypes = ['text', 'search', 'url', 'tel', 'password'];
return function() {
if (!supportedTypes.includes(this.type)) {
return;
}
const cursor = { start: this.selectionStart, end: this.selectionEnd };
func.apply(this, arguments);
this.setSelectionRange(cursor.start, cursor.end);