Skip to content

Conversation

@muskgupta
Copy link
Member

@muskgupta muskgupta commented Jan 8, 2026

Description

Updating textinput core component's validation field to reflect existing pattern if entered.
Customer : Suncorp

Related Issue

E-001967925

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

if (formatComponent && !formatComponent.closest("div").hasAttribute("hidden") && displayPatternSelectedValue!="custom") {
formatComponent.value = patternComponent.value;
// Preserve a previously saved pattern (when no dropdown options are present)
formatComponent.value = formatComponent.value || patternComponent.value;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this also impact other components? was custom format working correctly for other components custom format?

Copy link
Member Author

Choose a reason for hiding this comment

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

This method is consumed by multiple components (textinput, telephoneinput, numberinput and datepicker) - i have tested all the components with the change added in new commit, no current functionality is broken.

@muskgupta muskgupta changed the title Updating textinput validation field to reflect existing pattern Updating input components' validation field to reflect existing pattern Jan 9, 2026
// Only update format component value if it exists and is not hidden
if (formatComponent && !formatComponent.closest("div").hasAttribute("hidden") && displayPatternSelectedValue!="custom") {
formatComponent.value = patternComponent.value;
// Only update format component value if it exists and is not hidden
Copy link
Member Author

@muskgupta muskgupta Jan 9, 2026

Choose a reason for hiding this comment

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

We will update the pattern value from dropdown only in cases where dropdown is visible. Earlier it was updating even on manual pattern entry where the dropdown was not visible and the pattern dropdown had value "" which was rewriting the entered format value from showing up subsequently in the dialog.

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.

3 participants