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

How to set options with including image for MultiSelect widget #6699

Closed
AngelaChenBJ opened this issue Aug 20, 2020 · 7 comments
Closed

How to set options with including image for MultiSelect widget #6699

AngelaChenBJ opened this issue Aug 20, 2020 · 7 comments
Labels
adopter: product Work-stream that directly helps a Product team. component: multiselect needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. package: @carbon/react @carbon/react proposal: open This request has gone through triaging. We're determining whether we take this on or not. role: design ✏️ role: dev 🤖 type: a11y ♿ type: enhancement 💡 version: 11 Issues pertaining to Carbon v11

Comments

@AngelaChenBJ
Copy link

AngelaChenBJ commented Aug 20, 2020

Hello, I'm using MultiSelect widget, and I need to show options with including image like below, it is just a mock example
p1
My question is how can I set options with including image in MultiSelect widget?
For MultiSelect widget, we provide items like in following format:
items={[{ id: 'item-1', text: 'Item 1' }, { id: 'item-2', text: 'Item 2' }]}
For the shown option content, it is from text field as it has the setting itemToString={item => (item ? item.text : '')}
I wonder how to include an image path in text field, so it can parse the image path correct and show image accordingly in the option, I tried to combine image path into text field, but it shows the path directly instead of image, I also tried to put image info into img widget, then combine it into text field along with other information, it also can't show image correctly. Below is a result from trying to put image info into img widget.
p2

@kglickman
Copy link

The Dropdown component has an itemToElement function that you can use to generate the html for each item. The Multiselect widget does not. It would be great if you could add that for this widget, too. Not only would it support the scenario above, but I have a use case where I want the hover text to have different information than just the full, untruncated value of the label. It could be used for that as well.

@joshblack
Copy link
Contributor

Hi there! 👋 Something that is tricky about this situation is how we should communicate both the image and then option text to a screen reader user. Ideally, the option would have a single text value that could be announced. However, as soon as additional information gets included it can make it hard to understand what the value is for the option as multiple things get announced.

Are the images in this example purely decoration, or do they serve some purpose for informing the user about an option?

@AngelaChenBJ
Copy link
Author

Actually it has some meaning here, I also expect that the MultiSelect widget can be more flexible to be customized.

@emyarod
Copy link
Member

emyarod commented Aug 25, 2020

on a side note, here are some related previous discussions on this issue #4913 #4977 #5023 #5578 #5698

@tw15egan
Copy link
Collaborator

tw15egan commented Aug 31, 2020

So would our next steps be to either:

  1. Add itemToElement to Multiselect to match the Dropdown experience, introduce possible a11y concerns if implemented improperly

or

  1. Remove itemToElement from Dropdown to match the Multiselect experience to ensure proper a11y, reduces the functionality of the components

@kglickman
Copy link

You can't remove itemToElement from dropdown. Teams are already using it. In particular, we use it to show a brief name in the list, with a complete name in the title attribute. I don't mean like for ellipsis. It would be like if my name was on the list and said Kate but when you hover it says Kathryn A Glickman.

@sstrubberg sstrubberg added component: multiselect type: enhancement 💡 role: dev 🤖 version: 11 Issues pertaining to Carbon v11 package: @carbon/react @carbon/react role: design ✏️ adopter: product Work-stream that directly helps a Product team. proposal: open This request has gone through triaging. We're determining whether we take this on or not. needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. and removed status: waiting for maintainer response 💬 labels Nov 30, 2022
@sstrubberg sstrubberg moved this to 🥶 Ice Box in Design System Nov 30, 2022
@sstrubberg sstrubberg moved this to Backlog in Roadmap Nov 30, 2022
@sstrubberg sstrubberg moved this from Backlog to Triage in Roadmap Nov 30, 2022
@sstrubberg
Copy link
Member

hey @AngelaChenBJ, sorry for the wait. Finally got this thing triaged. Based on the conversation. This feels like a feature request to add functionality to Multi-select. Due to roadmap contraints, we won't be able to pick this up any time soon, but we're happy to accept a PR if you're up to it. Keep in mind, there is a dicey road ahead with accessibility concerns, so safe travels :)

@sstrubberg sstrubberg moved this from 🥶 Ice Box to 🕵️‍♀️ Triage in Design System Nov 30, 2022
@sstrubberg sstrubberg moved this from Triage to Multiselect in Roadmap Nov 30, 2022
Repository owner moved this from Multiselect to Not pursuing in Roadmap Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adopter: product Work-stream that directly helps a Product team. component: multiselect needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. package: @carbon/react @carbon/react proposal: open This request has gone through triaging. We're determining whether we take this on or not. role: design ✏️ role: dev 🤖 type: a11y ♿ type: enhancement 💡 version: 11 Issues pertaining to Carbon v11
Projects
Archived in project
Development

No branches or pull requests

6 participants