mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
feat(toast): add htmlAttributes property for passing attributes to buttons (#27855)
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 `ToastButton` interface - Passes the `htmlAttributes` to the buttons - Adds a test to verify `aria-label` and `aria-labelled-by` are passed to the button ## Does this introduce a breaking change? - [ ] Yes - [x] No
This commit is contained in:
@ -405,7 +405,14 @@ export class Toast implements ComponentInterface, OverlayInterface {
|
||||
return (
|
||||
<div class={buttonGroupsClasses}>
|
||||
{buttons.map((b) => (
|
||||
<button type="button" class={buttonClass(b)} tabIndex={0} onClick={() => this.buttonClick(b)} part="button">
|
||||
<button
|
||||
{...b.htmlAttributes}
|
||||
type="button"
|
||||
class={buttonClass(b)}
|
||||
tabIndex={0}
|
||||
onClick={() => this.buttonClick(b)}
|
||||
part="button"
|
||||
>
|
||||
<div class="toast-button-inner">
|
||||
{b.icon && (
|
||||
<ion-icon
|
||||
|
||||
Reference in New Issue
Block a user