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: properly validate typed in emails and set them on comma or semi-colon key presses #1978

Merged
merged 7 commits into from
Dec 15, 2022

Conversation

musale
Copy link
Contributor

@musale musale commented Dec 8, 2022

Closes #1970

PR Type

  • Bugfix

Description of the changes

  • Changed the RegEx for validating emails to this https://www.emailregex.com
  • Added an internal state property this._setAnyEmail to check whether the comm or semi-colon keys have been pressed. If truthy, then set the any email typed if it is valid.
  • Refactors to change the deprecated internalProperty to state.

PR checklist

  • Project builds (yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)
  • All public APIs (classes, methods, etc) have been documented following the jsdoc syntax
  • Stories have been added and existing stories have been tested
  • Added appropriate documentation. Docs PR:
  • License header has been added to all new source files (yarn setLicense)
  • Contains NO breaking changes

Other information

this._setAnyMail property is used to check if the comma or semi-colon have been pressed. If they have, then the typed email is checked if it is a valid email and set accordingly.
@ghost
Copy link

ghost commented Dec 8, 2022

Thank you for creating a Pull Request @musale.

This is a checklist for the PR reviewer(s) to complete before approving and merging this PR:

  • I have verified a documentation PR has been linked and is approved (or not applicable)
  • I have ran this PR locally and have tested the fix/feature
  • I have verified that stories have been added to storybook (or not applicable)
  • I have tested existing stories in storybook to verify no regression has occured
  • I have tested the solution in at least two browsers (Edge + 1 non-Chromium based browser)

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

The updated storybook is available here

3 similar comments
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

The updated storybook is available here

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

The updated storybook is available here

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

The updated storybook is available here

Copy link
Member

@gavinbarron gavinbarron left a comment

Choose a reason for hiding this comment

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

not sure about changing internalProperty to state for builds targeting main

@sebastienlevert
Copy link
Contributor

When typing an email, I can't make it "selected" by tapping enter or whatever. This needs to be fixed.

@musale
Copy link
Contributor Author

musale commented Dec 13, 2022

When typing an email, I can't make it "selected" by tapping enter or whatever. This needs to be fixed.

I have fixed this. So, setting an email is done when you press comma, semi-colon or enter keys.

@github-actions
Copy link

The updated storybook is available here

1 similar comment
@github-actions
Copy link

The updated storybook is available here

@github-actions
Copy link

The updated storybook is available here

@gavinbarron gavinbarron merged commit 2f03ee5 into main Dec 15, 2022
@gavinbarron gavinbarron deleted the musale/fix-allow-anymail branch December 15, 2022 17:28
This was referenced Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] mgt-people-picker allow-any-email not working
3 participants