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
feat(Form): add form group label info & docs(Form): add password strength demo #6053
Conversation
PF4 preview: https://patternfly-react-pr-6053.surge.sh |
Updated to include the password strength demo. @mattnolting @mcoker @mcarrano Is there a set way to calculate password strength that we want for this demo? It was unclear in the design what the rules are for the strength of a password. Currently I have it counting how many times the 3 minimum required rules are being met and with more uppercase/special characters or digits the stronger the password becomes. |
@kmcfaul I think what you are doing is probably fine to demo this. We don't have any particular standard for predicting password strength that we are recommending through PatternFly. @ajacobs21e is there any particular rules you would recommend applying for the purpose of this demo? |
@kmcfaul @mcarrano Red Hat uses an algorithm to output a score. I can find out what it is if you'd like. |
Is it worth bringing in another library for just a demo? The code shows how the UI will change and users can implement their own validation/strength algorithm in place of the demo function. |
@kmcfaul I agree that it does not make sense to pull in an external library. Maybe there should just be mention that this demo is only to show how to reflect status in the UI, but does not intend to specify any particular validation technique. @ajacobs21e do you think it would make sense to reflect the InfoSec recommendation in the design doc that relates to this or do you think PatternFly should just steer clear of that? |
@mcarrano Updated the example docs to include a short note. Let me know if that looks good (once it finishes building). |
@kmcfaul how about just adding one more sentence: "We expect consumers will substitute their own, more robust, validation algorithm." |
Yeah that would be great to mention their recommendation. thanks! |
@mcarrano @ajacobs21e Updated the example disclaimer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks for adding the disclaimer @kmcfaul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one comment about the validation text.
f713d9d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kmcfaul !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense for mouse and keyboard users, but I think that we should follow the same pattern that we have for our validated form example, particularly for screen reader users.
The input should have an aria-describedby
attribute that points to the helper text, and it should be aria-invalid
when validation isn't met. It looks like your example has that, but the aria-describedby
points to an id that doesn't exist, and it also looks like the aria-invalid
never updates. Then the helper text should be inside of an aria-live="polite"
to let the screen reader know that the text will change/update.
@jessiehuff Updated with your feedback. Let me know if the aria-live region is updating properly when it finishes building (I wrapped the HelperText with the div). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested in VO, JAWS, and NVDA, and I'm seeing kind of unreliable results. I was only able to get the helper text to announce once in VO. When I compare the demo to our form invalid example, I think the things that might be affecting it are that aria-invalid
never updates (it's always "false"), and the id that the aria-describedby
points to is on a different element than the one with the aria-live
. Perhaps that's causing the issue? I don't want to hold up the release though for this so we could create an issue to refine this more. At least the helper text seems discoverable in the normal DOM order on its own.
Pushed one last update moving the aria-live and fixing the aria-invalid not being updated. Hopefully that puts the PR in a decent state to merge, we can open a followup to better fit the screenreaders if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great job! 😄
What: Closes #6002 & #5819
Adds
labelInfo
property toFormGroup
.Adds new unit test, example and integration test.
Also updates some duplicate ids in the examples.
Update: Adds password strength demo