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

Select2 single choice - wrong clear title / tooltip #5616

Open
florianlacreuse opened this issue Aug 22, 2019 · 8 comments
Open

Select2 single choice - wrong clear title / tooltip #5616

florianlacreuse opened this issue Aug 22, 2019 · 8 comments

Comments

@florianlacreuse
Copy link

Hi,

Since PR #4530, the clear icon to remove all the selected items in Select2 multiple choices has a title / tooltip. However, this new title is now also applied to the clear icon for Select2 single choice, whereas it makes much less sens to have 'Remove all items' as a tooltip in the case of a single / unique choice component.

Reduce test case: https://codepen.io/florianlacreuse/pen/jONVogy

@alanricheydev
Copy link

I am going to hop on this and get a PR in this weekend. :)

@stale
Copy link

stale bot commented Dec 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale label Dec 18, 2019
@florianlacreuse
Copy link
Author

There is a PR in progress. See #5671.

@stale stale bot removed the status: stale label Dec 19, 2019
@stale
Copy link

stale bot commented Feb 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale label Feb 17, 2020
@florianlacreuse
Copy link
Author

There is a PR in progress. See #5671.

@kevin-brown
Copy link
Member

Cloning what I put in #5671 (comment)

Thank you for the pull request! I've been thinking about this one for a couple of days, trying to decide how to best handle this knowing that there are some changes in the pipeline for handling accessibility in future versions of Select2. And I'm honestly still thinking.

  1. We're looking to add title text for the individual "remove" buttons on selected items for a multiple select. This would also likely apply to the "clear" button for a single select, but we'll see when it gets implemented. The translation we would try to target is removeItem and we would be injecting the option text into the translated message (so it says "Remove Alaska" instead of "Remove item")
  2. I'd also like to modify the removeAllItems translation so it either reads out the number of items it's removing or the individual titles. Ideally it would pass in the data as a parameter so people could override this on their own for greater flexibility.
  3. Because the plan is to allow user-submitted data within title attributes, we need to move away from injecting the title attribute by string concatenation and move towards injecting it using .setAttribute('title', value)/.title = value, to avoid future XSS issues.

@dmmishchenko
Copy link

Hi, what is the current status of this issue?

@florianlacreuse
Copy link
Author

Still open, a PR had been made by another developer but was not merged (closed). I still haven't had any feedback from maintainers.

(AFAIK)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants