Skip to content

Add inline validation for preset fields with regex pattern#11925

Open
Shyam-123pandey wants to merge 4 commits intoopenstreetmap:developfrom
Shyam-123pandey:feature/inline-field-pattern-validation
Open

Add inline validation for preset fields with regex pattern#11925
Shyam-123pandey wants to merge 4 commits intoopenstreetmap:developfrom
Shyam-123pandey:feature/inline-field-pattern-validation

Conversation

@Shyam-123pandey
Copy link

@Shyam-123pandey Shyam-123pandey commented Feb 25, 2026

valid

Add inline validation for fields that define a regex pattern

Summary

This PR adds inline validation support for preset fields that define a pattern (regex).

If a field includes a regex pattern and the entered value does not match it, an informational message is displayed directly below the input field.

Behavior

  • Validation runs on blur / change, not while typing.
  • The message appears only after the user finishes editing the field.
  • If the value becomes valid, the message disappears.
  • This does not block saving.
  • This does not create or modify issues in the issues panel.
  • It only applies to fields that define a pattern.

Why

Some fields may define a regex pattern but currently provide no direct feedback when the value does not match the expected format.

This change improves UX by giving contextual, field-level feedback after editing is complete, while staying consistent with iD’s existing interaction model (no validation on every keystroke).

Scope

  • Changes limited to uiFieldText.
  • No changes to the validation engine.
  • No preset/schema changes.

Closes #10769

Copilot AI review requested due to automatic review settings February 25, 2026 11:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds inline, non-blocking validation feedback for text inputs whose preset field definition includes a regex pattern, improving UX by showing/hiding a message as the user types.

Changes:

  • Add a validation message element to uiFieldText’s DOM structure.
  • Validate input values against field.pattern during change() and toggle the message visibility/text accordingly.

@Shyam-123pandey

This comment was marked as spam.

@Shyam-123pandey
Copy link
Author

Shyam-123pandey commented Feb 26, 2026

Good After noon Sir, Almost things have been resolved just check , I have doubt on one issue as copilot suggested please check above, so suggest for that.

@Shyam-123pandey

This comment was marked as spam.

@Shyam-123pandey

This comment was marked as spam.

@Shyam-123pandey

This comment was marked as spam.

@Shyam-123pandey

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show validation suggestion for non-matching field pattern

3 participants