JaleelB / emblor

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

feat(tag-input): add ability to pass props and className to the inline tags container #58

Closed jersoncarin closed 1 week ago

jersoncarin commented 2 weeks ago

Ability to add propsand className to inline tags container is needed since we currently can't customize or add styling.

For example, in the image, we can't customize or remove the border because we can't update the className or add styling to the inline tags container.

image

We can use to add some the styling inlineTagsProps We can use to add/update the className inlineTagsClassName

Update: I managed to change and customize the container by getting the parentElement from the input props

<TagInput
          inputProps={{ id: "input-tags" }}
          activeTagIndex={activeTagIndex}
          setActiveTagIndex={setActiveTagIndex}
          placeholder="Add up 4 tags..."
          tags={tags}
          className="w-full border-0 outline-none placeholder:text-foreground/60"
          setTags={(newTags) => setTags(newTags) }
 />

then in useEffect

useEffect(() => {
   const inputTag = document.getElementById("input-tags")
   if (inputTag && inputTag.parentElement) {
       // now we can access the inline tags container by inputTag.parentElement element
   }
  }, [])

but this solution is not intuitive and add extra code which is not good.

vercel[bot] commented 2 weeks ago

@jersoncarin is attempting to deploy a commit to the jaleelb's projects Team on Vercel.

A member of the Team first needs to authorize it.

JaleelB commented 1 week ago

This issue has been resolved with the implementation in PR #59. The changes discussed have been incorporated