Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label customization via options #1134

Closed
iosonogio opened this issue Dec 30, 2020 · 4 comments
Closed

Label customization via options #1134

iosonogio opened this issue Dec 30, 2020 · 4 comments

Comments

@iosonogio
Copy link

Hi, while appreciating a lot this good piece of work, I would like to suggest an improvement:

it would be nice to have new options to let you customize the aria-label's that are set on buttons and dots, so users may provide custom labels and even translation (for non-English speakers).

It seems to me that this might be fairly simple to implement through the use of the options variable in page-dots.js and prev-next-button.js.

@iosonogio
Copy link
Author

This is how it goes:

proof of concept in prev-next-button.js:

element.setAttribute( 'aria-label', this.isPrevious ? 
    (this.parent.options.labelPrevious ? this.parent.options.labelPrevious : 'Previous') :
    (this.parent.options.labelNext ? this.parent.options.labelNext : 'Next')
);

and in page-dots.js:

dot.setAttribute( 'aria-label', (this.parent.options.labelPagedot ? 
    this.parent.options.labelPagedot+' ' : 
    'Page dot ') + ( i + 1 )
);

@desandro
Copy link
Member

desandro commented Jan 3, 2021

Thanks for this suggestion. Others have asked for custom ARIA attributes. See related #886

@iosonogio
Copy link
Author

iosonogio commented Jan 6, 2021

Thanks for this suggestion. Others have asked for custom ARIA attributes. See related #886

Hi thank you for caring. Apologies for missing the related #886, it seems like you implemented it like the way I proposed here. Hope you can merge it in the codebase soon :)

@desandro
Copy link
Member

desandro commented Jan 7, 2021

I'll be evaluating how to improve accessibility in a future major release for Flickity.

Closing this issue. Please continue discussion in #886

@desandro desandro closed this as completed Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants