Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Adjust the input allowed for the Claim Delay input field #3794

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rumzledz
Copy link
Contributor

Description

I'm just simply doing a check to see if the most recent version of the input conforms with our cleave rule. If not, then don't allow the field value to be updated.

Testing

  1. Bring up the Advanced Payment form
  2. Enter a space or a letter inside the Claim delay field
  3. Verify that the field value doesn't get updated

Resolves #3479

@rumzledz rumzledz self-assigned this Nov 27, 2024
@rumzledz rumzledz marked this pull request as ready for review November 27, 2024 16:04
@rumzledz rumzledz requested a review from a team as a code owner November 27, 2024 16:04
@rumzledz rumzledz changed the title fix: prevent non-cleave format conforming input Fix: adjust the input allowed for the Claim Delay input field Nov 27, 2024
@rumzledz rumzledz changed the title Fix: adjust the input allowed for the Claim Delay input field Fix: Adjust the input allowed for the Claim Delay input field Nov 28, 2024
Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

Nice start on this issue @rumzledz 🙌

Unfortunately I can still reproduce the issue upon initially entering a space

Screen.Recording.2024-11-28.at.10.06.02.mov

Also noticed this error in the console
Screenshot 2024-11-28 at 10 07 28

So probably we need to add this prop to the input field value={field.value ?? ''}

Also left a comment for how we should update the if condition for the issue to not be present anymore on this field. However, please feel free to be ✨ creative ✨

Comment on lines 89 to 96
if (formattedValue === field.value) {
return;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

From my testing, in order to avoid the issue upon initially entering a space, I believe we have to update this condition to

          if (
            (!field.value && !formattedValue) ||
            formattedValue === field.value 
          ) {
            return;
          }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that pesky space... thanks for this @mmioana !

@rumzledz rumzledz requested review from mmioana and a team November 28, 2024 09:19
@rumzledz rumzledz force-pushed the fix/3479-prevent-non-cleave-rule-conforming-input branch from 3e7f60d to 3f10fb2 Compare November 28, 2024 09:19
@rumzledz rumzledz force-pushed the fix/3479-prevent-non-cleave-rule-conforming-input branch from 3f10fb2 to ac0adb5 Compare November 28, 2024 09:36
Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

Smashed 💯

Screen.Recording.2024-11-28.at.13.11.00.mov

And no error regarding the uncontrolled input is showing up in the console

Screenshot 2024-11-28 at 13 12 10

Copy link
Contributor

@Nortsova Nortsova left a comment

Choose a reason for hiding this comment

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

Niice ✨ I tested different whitespace characters and everything works great 👏

claim-delay-enter-space

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.

Entering a letter or space in the claim delay field breaks input
3 participants