react-tailwindcss-select icon indicating copy to clipboard operation
react-tailwindcss-select copied to clipboard

formatTagItem

Open Djboy08 opened this issue 2 years ago • 4 comments

Currently we have formatting functions for options and groups. However, atleast with my observations so far there is no function for the data inside the button itself. For my use case I have custom tags I want to be able to also represent in the button itself but unable to do so.

image

Djboy08 avatar Mar 07 '23 03:03 Djboy08

Hello @Djboy08 👋

Can you give me some more information or code?

cha2hyun avatar Mar 07 '23 04:03 cha2hyun

Yeah so in the image I provided I was talking about the location where it says Type 2. I wish we could add our own html in there as I would prefer being able to have something like the bottom formatted options to also be put in the top when its selected.

However, from what I could see there is no way to do this and you can only alter the css of the menu button but not change it depending on the data associated with it.

So what I ideally would like is if I clicked on Test 2 or Test 3 in the provided image, that exact option could also show up in the image button.

Something like a formatSelectedOption or something would be nice :)

Djboy08 avatar Mar 07 '23 05:03 Djboy08

image

You can see in this example my options are my own custom css styling but is there anyway to make the selected values also custom css?

Djboy08 avatar Mar 10 '23 19:03 Djboy08

I noticed there was a tagItem prop, sadly this doesnt solve my use case as this is the only time I can't use tailwind css to acomplish my needs by applying css to said tags. I need to be able to change the background use hex.

so really I guess what I want is a formatTagItem callback, this would be incredibly useful.

Djboy08 avatar Mar 10 '23 19:03 Djboy08