mirror of
https://github.com/desktop/desktop
synced 2024-10-31 05:19:03 +00:00
Dropdown button aria attributes
This commit is contained in:
parent
8450d2ac67
commit
e0789094f4
4 changed files with 10 additions and 1 deletions
|
@ -31,6 +31,9 @@ interface IDropdownSelectButtonProps<T extends string> {
|
|||
/** tooltip for the button */
|
||||
readonly tooltip?: string
|
||||
|
||||
/** aria label for the button */
|
||||
readonly dropdownAriaLabel: string
|
||||
|
||||
/** Callback for when the button selection changes*/
|
||||
readonly onCheckedOptionChange?: (
|
||||
selectedOption: IDropdownSelectButtonOption<T>
|
||||
|
@ -237,7 +240,7 @@ export class DropdownSelectButton<
|
|||
}
|
||||
|
||||
public render() {
|
||||
const { options, disabled } = this.props
|
||||
const { options, disabled, dropdownAriaLabel } = this.props
|
||||
const {
|
||||
checkedOption: selectedOption,
|
||||
optionsPositionBottom,
|
||||
|
@ -274,6 +277,9 @@ export class DropdownSelectButton<
|
|||
className={dropdownClasses}
|
||||
onClick={this.openSplitButtonDropdown}
|
||||
type="button"
|
||||
ariaExpanded={showButtonOptions}
|
||||
ariaHaspopup={true}
|
||||
ariaLabel={dropdownAriaLabel}
|
||||
>
|
||||
<Octicon symbol={OcticonSymbol.triangleDown} />
|
||||
</Button>
|
||||
|
|
|
@ -183,6 +183,7 @@ export class MergeCallToActionWithConflicts extends React.Component<
|
|||
<DropdownSelectButton
|
||||
checkedOption={this.state.selectedOperation}
|
||||
options={getMergeOptions()}
|
||||
dropdownAriaLabel="Merge options"
|
||||
disabled={disabled}
|
||||
onCheckedOptionChange={this.onOperationChange}
|
||||
onSubmit={this.onOperationInvoked}
|
||||
|
|
|
@ -243,6 +243,7 @@ export abstract class BaseChooseBranchDialog extends React.Component<
|
|||
checkedOption={operation}
|
||||
options={getMergeOptions()}
|
||||
disabled={!this.canStart()}
|
||||
dropdownAriaLabel="Merge options"
|
||||
tooltip={this.getSubmitButtonToolTip()}
|
||||
onCheckedOptionChange={this.onOperationChange}
|
||||
/>
|
||||
|
|
|
@ -162,6 +162,7 @@ export class DropdownSuggestedAction<T extends string> extends React.Component<
|
|||
value,
|
||||
}))}
|
||||
disabled={disabled}
|
||||
dropdownAriaLabel="Suggested actions for this branch"
|
||||
onCheckedOptionChange={this.onActionSelectionChange}
|
||||
onSubmit={this.onActionSubmitted}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue