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

Question about the PeoplePicker and the HTML rendered #1941

Open
GarthMartin opened this issue Jan 22, 2025 · 1 comment
Open

Question about the PeoplePicker and the HTML rendered #1941

GarthMartin opened this issue Jan 22, 2025 · 1 comment

Comments

@GarthMartin
Copy link

2-pronged question, but both about the HTML being rendered. I apologize if missing info, but I am new to React and these components.

We are building a SPFX web part to do correspondence tracking. I have one page where I need 2 peoplepickers on the page for different purposes.

When I try to validate the HTML rendered I get duplicate ID's on the <div id="people"> and <div id="pntp">, because of course have 2 pickers on the page.

The other thing I have noticed is that the label generated is not associated with the input control generated for the picker when using the options:

<PeoplePicker
                context={{
                  ...context,
                  absoluteUrl: context.pageContext.web.absoluteUrl,
                  msGraphClientFactory: context.msGraphClientFactory,
                  spHttpClient: context.spHttpClient,
                }}
                titleText={t('groups.selectOwner')}
                required={true}
                personSelectionLimit={1}
                groupName={""} // Leave this blank for no group
                showtooltip={true}
                principalTypes={[PrincipalType.User]}
                resolveDelay={1000}
                onChange={ownerSearchOnChange}
                defaultSelectedUsers={selectedUsers}
              />
        </div>

Both these items are going to trigger accessibility issues. Am I missing something?

On another note, the required=true does not seem to make the field mandatory if no user has been selected, but that's likely a subject for another post.

Copy link

Thank you for submitting your first issue to this project.

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

No branches or pull requests

1 participant