mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
feat(action-sheet): add htmlAttributes property for passing attributes to buttons (#27863)
Issue number: N/A --------- ## What is the current behavior? Buttons containing only icons are not accessible as there is no way to pass an `aria-label` attribute (or any other html attribute). ## What is the new behavior? - Adds the `htmlAttributes` property on the `ActionSheetButton` interface - Passes the `htmlAttributes` to the buttons (both the buttons array and the cancelButton) - Adds two tests to verify `aria-label` and `aria-labelled-by` are passed to a button with and without the cancel role - this was done because action sheet breaks these buttons up when rendering ## Does this introduce a breaking change? - [ ] Yes - [x] No
This commit is contained in:
@ -23,6 +23,7 @@ export interface ActionSheetButton<T = any> {
|
||||
icon?: string;
|
||||
cssClass?: string | string[];
|
||||
id?: string;
|
||||
htmlAttributes?: { [key: string]: any };
|
||||
handler?: () => boolean | void | Promise<boolean | void>;
|
||||
data?: T;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user