mskocik / svelecte

Flexible autocomplete/select component written in Svelte,
https://svelecte.vercel.app
MIT License
472 stars 44 forks source link

styling open select #223

Closed nosovk closed 7 months ago

nosovk commented 7 months ago

We can pass a slot, that will be rendered as an item in a selected state, but I can't find how to pass a slot to style opened element. Is there some named slot or any other way to style elements in opened list?

mskocik commented 7 months ago

What do you mean by "opened element"? Is it option in dropdown? If yes, you can use <slot name="option>

What is missing from your point of view in docs?

nosovk commented 7 months ago

My fault. It's there. In common, the best is to put some example into renderer serction.

image

Like this, to show that list items could be customized.

mskocik commented 7 months ago

You mean like in the list on the right? image

nosovk commented 7 months ago

Yes, but from the screen above with red rectangles there is no clear what exactly is possible. Actually I got response from team-mate that it's not possible to render custom slot inside open slider, and after that opened ticked. (My fault that I didn't check it carefully). I think that my team mate browsed examples page, didn't find any one with custom slot, and probably go to conclusion that it's not possible (I will ask him to confirm that on monday. It would be nice just to extend example with colours, with additional block showing how it looks)

mskocik commented 7 months ago

So basically you mean something like this REPL should be in examples.

Documentation could be extended for sure. Slot usage may not be obvious. Unfortunately it's quite time-consuming process, which I don't enjoy that much and it's hard to judge what is not clear enough (author blindness).