JaleelB / emblor

A fully-featured tag input component built with shadcn/ui
https://emblor.jaleelbennett.com
MIT License
526 stars 23 forks source link

AutoComplete inside a Popover #32

Closed asaf closed 1 month ago

asaf commented 1 month ago

When autoComplete is enabled, I suggest making it possible to render the possible options inside a popover to avoid allocating too much screen space for this component.

Such as the Status dropdown filter in https://ui.shadcn.com/examples/tasks

kavinda1995 commented 1 month ago

+1 to this. Not having a popover makes this library a no-go for mobile devices

JaleelB commented 1 month ago

https://github.com/JaleelB/emblor/assets/78449846/109d251c-12a8-4307-b70a-14dc5aa2b2ab

@asaf This is something you can already do by passing the usePopoverForTags boolean. See the general properties under the API reference page: https://emblor.jaleelbennett.com/api-reference

asaf commented 1 month ago

But the list of all possible tags is always opened and with static 10 elements.

kavinda1995 commented 1 month ago

Isn't it only shows the entered tags? @JaleelB

JaleelB commented 1 month ago

But the list of all possible tags is always opened and with static 10 elements.

@asaf What do you mean by static 10 elements? You can extend the number of items in the list of auto-complete options. Regarding the list of auto-complete options always being shown, I see what you mean. I'll add a feature to only show it on input focus or something. That was a misunderstanding on my part with your original comment

JaleelB commented 1 month ago

Isn't it only shows the entered tags? @JaleelB

@kavinda1995 Yes, the popover shows the entered tags to prevent them from causing a long tag list which could possibly cause layout shifts. Regarding the possible options, I will work on a feature to toggle showing it list on focus or something. I misunderstood the original comment

asaf commented 1 month ago

I think it make sense, it can shrink down into a sort of a selectbox to avoid taking large portion of the screen :) this is somewhat relevant to https://github.com/JaleelB/emblor/issues/29

JaleelB commented 1 month ago

@asaf @kavinda1995
The enhancements discussed in this thread have been addressed in the v1.2.0 release.

Key Improvements:

Thank you for your feedback! Feel free to test the new version and provide further feedback if needed.