1
0
mirror of synced 2025-02-19 05:23:15 +03:00

add tooltip for expand buttons, closes #5566

This commit is contained in:
Igor Vaynberg 2019-07-17 08:05:48 -07:00
parent 54a388de15
commit 44a88a9c56
6 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,4 @@
// TODO make it so keys can be strings in addition to functions
export interface Dictionary { export interface Dictionary {
valueAdded(itemLabel: string): string; valueAdded(itemLabel: string): string;
noSearchResults(): string; noSearchResults(): string;
@ -6,6 +7,7 @@ export interface Dictionary {
clearButtonTitle(): string; clearButtonTitle(): string;
minimumCharactersMessage(len: number, min: number): string; minimumCharactersMessage(len: number, min: number): string;
multiSelectInstructions(): string; multiSelectInstructions(): string;
expandButtonTitle(): string;
} }
const EN_US: Dictionary = { const EN_US: Dictionary = {
@ -36,6 +38,10 @@ const EN_US: Dictionary = {
multiSelectInstructions(): string { multiSelectInstructions(): string {
return "Items can be removed from this list box by selecting them and activating 'Remove selected values' button. Items can be added by selecting them in the adjacent combobox."; return "Items can be removed from this list box by selecting them and activating 'Remove selected values' button. Items can be added by selecting them in the adjacent combobox.";
},
expandButtonTitle(): string {
return 'Expand';
} }
}; };

View File

@ -188,7 +188,13 @@ export class MultiSelect extends AbstractSelect<Props, State> {
onFocus={this.onSearchFocus} onFocus={this.onSearchFocus}
placeholder={placeholder} placeholder={placeholder}
/> />
<div className={cn(style.toggle)} aria-hidden={true} tabIndex={-1} onClick={this.onToggleClick}> <div
className={cn(style.toggle)}
aria-hidden={true}
tabIndex={-1}
onClick={this.onToggleClick}
title={dictionary.expandButtonTitle()}
>
<Toggle height={20} width={20} /> <Toggle height={20} width={20} />
</div> </div>
</div> </div>

View File

@ -128,7 +128,7 @@ export class SingleSelect extends AbstractSelect<Props, State> {
</button> </button>
); );
})} })}
<div className={style.toggle} aria-hidden={true}> <div className={style.toggle} aria-hidden={true} title={dictionary.expandButtonTitle()}>
<Toggle height={20} width={20} /> <Toggle height={20} width={20} />
</div> </div>
</div> </div>

View File

@ -17,7 +17,7 @@ exports[`MultiSelect renders with empty values 1`] = `
<input type="text" value class="s25-search" role="combobox" <input type="text" value class="s25-search" role="combobox"
aria-label="Add Value" aria-autocomplete="list" aria-haspopup="true" aria-owns="s25-0-results" aria-label="Add Value" aria-autocomplete="list" aria-haspopup="true" aria-owns="s25-0-results"
aria-controls="s25-0-results" aria-expanded="false" /> aria-controls="s25-0-results" aria-expanded="false" />
<div class="s25-toggle" aria-hidden tabIndex="-1"> <div class="s25-toggle" aria-hidden tabIndex="-1" title="Expand">
<Toggle height="20" width="20"></Toggle> <Toggle height="20" width="20"></Toggle>
</div> </div>
</div> </div>
@ -55,7 +55,7 @@ exports[`MultiSelect renders with values 1`] = `
<input type="text" value class="s25-search" role="combobox" <input type="text" value class="s25-search" role="combobox"
aria-label="Add Value" aria-autocomplete="list" aria-haspopup="true" aria-owns="s25-1-results" aria-label="Add Value" aria-autocomplete="list" aria-haspopup="true" aria-owns="s25-1-results"
aria-controls="s25-1-results" aria-expanded="false" /> aria-controls="s25-1-results" aria-expanded="false" />
<div class="s25-toggle" aria-hidden tabIndex="-1"> <div class="s25-toggle" aria-hidden tabIndex="-1" title="Expand">
<Toggle height="20" width="20"></Toggle> <Toggle height="20" width="20"></Toggle>
</div> </div>
</div> </div>

2
dist/select25.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long