Skip to content

Commit

Permalink
backport: fix crash when rendering and email UI field (#9752)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd committed Jul 12, 2023
1 parent 1234cca commit 59c8b79
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -35,6 +35,15 @@ _Breaking developer changes, which may affect downstream projects or sites that
[@xxxx]: https://github.com/xxxx
-->


# 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
#### :tada: New Features
* Combo fields for tags with `yes/no` values now also display the `no` state and allow to toggle between the two states ([#7427])
Expand Down
6 changes: 5 additions & 1 deletion dist/iD.js
Expand Up @@ -22762,7 +22762,7 @@
// package.json
var package_default = {
name: "iD",
version: "2.26.0",
version: "2.26.1",
description: "A friendly editor for OpenStreetMap",
main: "dist/iD.min.js",
repository: "github:openstreetmap/iD",
Expand Down Expand Up @@ -25793,7 +25793,11 @@
return value2 === null || value2 === void 0 ? valueNull : typeof value2 === "function" ? valueFunction : valueConstant;
}
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);
Expand Down
4 changes: 2 additions & 2 deletions dist/iD.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/iD.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/iD.min.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions modules/util/get_set_value.js
Expand Up @@ -28,7 +28,13 @@ export function utilGetSetValue(selection, value, shouldUpdate) {
}

function stickyCursor(func) {
// only certain input element types allow manipulating the cursor
// see https://html.spec.whatwg.org/multipage/input.html#concept-input-apply
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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "iD",
"version": "2.26.0",
"version": "2.26.1",
"description": "A friendly editor for OpenStreetMap",
"main": "dist/iD.min.js",
"repository": "github:openstreetmap/iD",
Expand Down

0 comments on commit 59c8b79

Please sign in to comment.