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: combobox attributes #2538

Merged
merged 5 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ <h2>mgt-login</h2>
<!-- <mgt-person-card person-query="me"></mgt-person-card> -->
<h2>mgt-people-picker</h2>
<mgt-people-picker show-max="6"></mgt-people-picker>
<!-- <h2>mgt-teams-channel-picker</h2>
<mgt-teams-channel-picker></mgt-teams-channel-picker> -->
<h2>mgt-teams-channel-picker</h2>
<mgt-teams-channel-picker></mgt-teams-channel-picker>
<!-- <h2>mgt-tasks</h2>
<mgt-tasks></mgt-tasks> -->
<!-- <h2>mgt-agenda group-by-day</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
slot="anchor"
id="people-picker-input"
role="combobox"
aria-expanded=${this.flyout?.isOpen ?? false}
placeholder=${placeholder}
aria-label=${this.ariaLabel || placeholder || this.strings.selectContact}
@click="${this.handleInputClick}"
Expand Down Expand Up @@ -924,6 +925,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
class="searched-people-list"
role="listbox"
aria-live="polite"
title=${this.strings.suggestionsTitle}
>
${repeat(
filteredPeople,
Expand Down Expand Up @@ -1262,7 +1264,6 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
flyout.close();
}
if (this.input) {
this.input.setAttribute('aria-expanded', 'false');
this.input.setAttribute('aria-activedescendant', '');
}
this._arrowSelectionCount = -1;
Expand All @@ -1279,9 +1280,6 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
if (flyout) {
flyout.open();
}
if (this.input) {
this.input.setAttribute('aria-expanded', 'true');
}
this._arrowSelectionCount = -1;
}

Expand Down Expand Up @@ -1371,7 +1369,6 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
private readonly lostFocus = () => {
this._isFocused = false;
if (this.input) {
this.input.setAttribute('aria-expanded', 'false');
this.input.setAttribute('aria-activedescendant', '');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ export const strings = {
inputPlaceholderText: 'Start typing a name',
noResultsFound: "We didn't find any matches.",
loadingMessage: 'Loading...',
suggestedContact: 'suggested contact',
suggestedContacts: 'suggested contacts',
selected: 'selected',
removeSelectedItem: 'remove selected item',
removeSelectedUser: 'Remove ',
selectContact: 'select a contact'
selectContact: 'select a contact',
suggestionsTitle: 'Suggested Contacts'
};
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export class MgtTeamsChannelPicker extends MgtTemplatedComponent {
placeholder="${this._selectedItemState ? '' : this.strings.inputPlaceholderText} "
label="teams-channel-picker-input"
role="combobox"
aria-expanded="${this._isDropdownVisible}"
@click=${this.gainedFocus}
@keyup=${(e: KeyboardEvent) => this.handleInputChanged(e)}>
<div slot="start" style="width: max-content;">${this.renderSelected()}</div>
Expand Down