From 396d14262377489cea24cefba82db748d6262f4e Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Wed, 12 Jul 2023 22:00:42 +0200 Subject: [PATCH] fix crash when rendering and `email` UI field, fixes #9752 --- CHANGELOG.md | 8 ++++++++ modules/util/get_set_value.js | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e6b4dc55..eb06d5556 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/modules/util/get_set_value.js b/modules/util/get_set_value.js index 597fa9b7c..cca02ddbd 100644 --- a/modules/util/get_set_value.js +++ b/modules/util/get_set_value.js @@ -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);