diff --git a/CHANGELOG.md b/CHANGELOG.md index 171e4f654..1e5d8f8c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index fc7e9ee96..915c0c45a 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -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; }