mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-13 12:55:05 +02:00
don't crash on invalid identifiers
fixes a bug where the link button would not be correctly disabled on invalid identifier values
(regression in 7015fae91c)
This commit is contained in:
@@ -45,6 +45,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
|
||||
#### :bug: Bugfixes
|
||||
* Validator: Don't falsely flag certain tags as "should be a closed area" if the tag also allows both area and line geometries in two separate presets (e.g. `highway=elevator` in the "Elevator" and "Inclined Lift" presets)
|
||||
* Fix sorting of nearby streets in address field dropdown
|
||||
* Fix bug where "outlink" buttons would not be disabled on invalid values of `identifier` fields
|
||||
#### :earth_asia: Localization
|
||||
#### :hourglass: Performance
|
||||
#### :mortar_board: Walkthrough / Help
|
||||
|
||||
@@ -195,6 +195,7 @@ export function uiFieldText(field, context) {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
})
|
||||
.classed('disabled', () => !validIdentifierValueForLink())
|
||||
.merge(outlinkButton);
|
||||
} else if (field.type === 'url') {
|
||||
input.attr('type', 'text');
|
||||
@@ -375,7 +376,7 @@ export function uiFieldText(field, context) {
|
||||
}
|
||||
}
|
||||
if (field.type === 'identifier' && field.pattern) {
|
||||
return value && value.match(new RegExp(field.pattern))[0];
|
||||
return value && value.match(new RegExp(field.pattern))?.[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user