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
+8
View File
@@ -49,6 +49,14 @@ _Breaking developer changes, which may affect downstream projects or sites that
#### :hammer: Development
# 2.26.1
##### 2023-Jul-12
* Fix crash when rendering and `email` UI field ([#9752])
[#9752]: https://github.com/openstreetmap/iD/issues/9752
# 2.26.0
##### 2023-Jul-12
+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);