Skip to content

Commit

Permalink
Merge branch 'accessibility/combo-box' of https://github.com/Refiniti…
Browse files Browse the repository at this point in the history
…v/refinitiv-ui into accessibility/combo-box
  • Loading branch information
phetw committed Dec 14, 2021
2 parents 27987c8 + 5b30826 commit 22a3ecc
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
justify-content: center;
align-items: center;
flex: none;
&:focus-visible {
outline: none;
color: @input-focused-border-color;
}
}

[part=list] {
Expand Down
2 changes: 2 additions & 0 deletions packages/elements/src/combo-box/__snapshots__/AsyncFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -54,6 +55,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down
2 changes: 2 additions & 0 deletions packages/elements/src/combo-box/__snapshots__/Filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -77,6 +78,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down
6 changes: 6 additions & 0 deletions packages/elements/src/combo-box/__snapshots__/Selected.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -85,6 +86,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -158,6 +160,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -232,6 +235,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<ef-counter
max="999"
Expand Down Expand Up @@ -316,6 +320,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -393,6 +398,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down
9 changes: 9 additions & 0 deletions packages/elements/src/combo-box/__snapshots__/Template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand All @@ -36,6 +37,7 @@
part="input"
placeholder="Placeholder"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand All @@ -59,6 +61,7 @@
part="input"
placeholder="New Placeholder"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand All @@ -81,6 +84,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand All @@ -106,6 +110,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -177,6 +182,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -247,6 +253,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -319,6 +326,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -391,6 +399,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down
7 changes: 7 additions & 0 deletions packages/elements/src/combo-box/__snapshots__/Value.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -85,6 +86,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -158,6 +160,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -232,6 +235,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -307,6 +311,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<ef-counter
max="999"
Expand Down Expand Up @@ -391,6 +396,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down Expand Up @@ -468,6 +474,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down
28 changes: 2 additions & 26 deletions packages/elements/src/combo-box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export class ComboBox<T extends DataItem = ItemData> extends FormFieldElement {
* Value of the list item that being highlight.
* Using for defined aria-activedescendant for accessibility
*/
private highlightedItemValue: string | null = null
private highlightedItemValue: string | null = null;

/**
* Use to call request update when CC changes its value
Expand Down Expand Up @@ -1017,27 +1017,6 @@ export class ComboBox<T extends DataItem = ItemData> extends FormFieldElement {
this.onInputWrapperTap();
}

/**
* Handles keydown on clear button
* @param event Key down event object
* @returns {void}
*/
protected onClearButtonKeydown (event: KeyboardEvent): void {
if (this.readonly) {
return;
}
switch (event.key) {
case ' ':
case 'Enter':
case 'Spacebar':
this.onClearsButtonTap();
break;
default:
return;
}
event.preventDefault();
}

/**
* Run when tap event happens on toggle button
* @returns {void}
Expand Down Expand Up @@ -1226,10 +1205,6 @@ export class ComboBox<T extends DataItem = ItemData> extends FormFieldElement {
<div
id="clears-button"
part="button button-clear"
tabindex="0"
role="button"
aria-label="${this.t('CLEAR')}"
@keydown=${this.onClearButtonKeydown}
?hidden=${!this.label && !this.query && !this.freeTextValue && !this.inputText}><ef-icon part="icon icon-clear" icon="cross"></ef-icon>
</div>
`;
Expand Down Expand Up @@ -1312,6 +1287,7 @@ export class ComboBox<T extends DataItem = ItemData> extends FormFieldElement {
return {
...super.decorateInputMap,
'part': 'input',
'type': 'text',
'role': 'combobox',
'.value': this.focused ? this.inputText : this.freeTextValue || this.label,
'aria-expanded': this.opened ? 'true' : 'false',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
autocomplete="off"
part="input"
role="combobox"
type="text"
>
<div
id="toggle-button"
Expand Down
3 changes: 1 addition & 2 deletions packages/phrasebook/src/locale/de/combo-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import './shared.js';

const translations = {
MULTIPLE_ITEMS: 'Mehrere Objekte',
NO_OPTIONS: 'Keine Ergebnisse',
CLEAR: 'Clear'
NO_OPTIONS: 'Keine Ergebnisse'
};

Phrasebook.define('de', 'ef-combo-box', translations);
Expand Down
3 changes: 1 addition & 2 deletions packages/phrasebook/src/locale/en/combo-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import './shared.js';

const translations = {
MULTIPLE_ITEMS: 'Multiple items',
NO_OPTIONS: 'No results found.',
CLEAR: 'Clear'
NO_OPTIONS: 'No results found.'
};

Phrasebook.define('en', 'ef-combo-box', translations);
Expand Down
3 changes: 1 addition & 2 deletions packages/phrasebook/src/locale/ja/combo-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import './shared.js';

const translations = {
MULTIPLE_ITEMS: '複数項目',
NO_OPTIONS: '該当する結果はありません。',
CLEAR: 'Clear'
NO_OPTIONS: '該当する結果はありません。'
};

Phrasebook.define('ja', 'ef-combo-box', translations);
Expand Down
3 changes: 1 addition & 2 deletions packages/phrasebook/src/locale/zh-hant/combo-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import './shared.js';

const translations = {
MULTIPLE_ITEMS: '多項',
NO_OPTIONS: '未找到結果。',
CLEAR: 'Clear'
NO_OPTIONS: '未找到結果。'
};

Phrasebook.define('zh-Hant', 'ef-combo-box', translations);
Expand Down
3 changes: 1 addition & 2 deletions packages/phrasebook/src/locale/zh/combo-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import './shared.js';

const translations = {
MULTIPLE_ITEMS: '多项',
NO_OPTIONS: '未找到结果。',
CLEAR: 'Clear'
NO_OPTIONS: '未找到结果。'
};

Phrasebook.define('zh', 'ef-combo-box', translations);
Expand Down

0 comments on commit 22a3ecc

Please sign in to comment.