Skip to content

Commit

Permalink
backport #9766 as v2.26.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd committed Jul 13, 2023
1 parent 59c8b79 commit ef9d93c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Expand Up @@ -36,6 +36,14 @@ _Breaking developer changes, which may affect downstream projects or sites that
-->


# 2.26.2
##### 2023-Jul-13

* Fix broken in raw tag editor ([#9766], thanks [@k-yle])

[#9766]: https://github.com/openstreetmap/iD/issues/9766


# 2.26.1
##### 2023-Jul-12

Expand Down Expand Up @@ -85,7 +93,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
* Upgrade OSM data dependencies: `id-tagging-schema` to v6.3, `osm-community-index` to 5.5.3
* Upgrade icon sets: `fortawesome` to v6.4, `temaki` to v5.4
* Upgrade `osm-auth` to v2.1,
* Upgrade dev dependecies, including the following major version upgrades: `glob` to v10, `marked` to v5, `cldr-core` and `cldr-localenames-full` to v43, `esbuild` to v0.18
* Upgrade dev dependencies, including the following major version upgrades: `glob` to v10, `marked` to v5, `cldr-core` and `cldr-localenames-full` to v43, `esbuild` to v0.18
* Build icons from configured presets source and also process field value `icons` in `npm run build:data`

[#8769]: https://github.com/openstreetmap/iD/pull/8769
Expand Down
10 changes: 5 additions & 5 deletions dist/iD.js
Expand Up @@ -22762,7 +22762,7 @@
// package.json
var package_default = {
name: "iD",
version: "2.26.1",
version: "2.26.2",
description: "A friendly editor for OpenStreetMap",
main: "dist/iD.min.js",
repository: "github:openstreetmap/iD",
Expand Down Expand Up @@ -25793,11 +25793,7 @@
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 All @@ -25809,6 +25805,10 @@
if (shouldUpdate === void 0) {
shouldUpdate = (a, b) => a !== b;
}
const supportedTypes = ["text", "search", "url", "tel", "password"];
if (!supportedTypes.includes(this.type)) {
return selection2.each(setValue(value, shouldUpdate));
}
return selection2.each(stickyCursor(setValue(value, shouldUpdate)));
}

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.

13 changes: 7 additions & 6 deletions modules/util/get_set_value.js
Expand Up @@ -28,13 +28,7 @@ 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 All @@ -49,5 +43,12 @@ export function utilGetSetValue(selection, value, shouldUpdate) {
shouldUpdate = (a, b) => a !== b;
}

// 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'];
if (!supportedTypes.includes(this.type)) {
return selection.each(setValue(value, shouldUpdate));
}

return selection.each(stickyCursor(setValue(value, shouldUpdate)));
}
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "iD",
"version": "2.26.1",
"version": "2.26.2",
"description": "A friendly editor for OpenStreetMap",
"main": "dist/iD.min.js",
"repository": "github:openstreetmap/iD",
Expand Down

0 comments on commit ef9d93c

Please sign in to comment.