JaleelB / emblor

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

UI issue with inline tags #40

Closed Codemaine closed 1 month ago

Codemaine commented 1 month ago

I saw you recently implemented the inline tags, and when I tried to implement it in my app, I got this styling issue.

image
JaleelB commented 1 month ago

Firstly, make sure you update to version 1.1.1 of the package. Version 1.1.1 corrected a styling issue I noticed. Check your package.json file to very that the version of the package is the latest one

Codemaine commented 1 month ago

Yea, I've confirmed it's on version 1.1.1

image
JaleelB commented 1 month ago

Yea, I've confirmed it's on version 1.1.1

image

OK. Send a reproduction of this error so I can better understand the context of your issue. I tried reproducing it but all instances I created have the correct styling implementation. Preferably a code sandbox or a hosted link so I can observe the dom

Codemaine commented 1 month ago

It's being used in a big project. Should I share how I used the component and our tailwindcss config file?

JaleelB commented 1 month ago

It's being used in a big project. Should I share how I used the component and our tailwindcss config file?

@Codemaine That would be helpful, so yes. I would still like you to recreate the environment outside your project to narrow down whether or not this issue was caused by something in your project. For this you can just create a simple Next.js app in a code sandbox, follow the shadcn setup guide, install and setup the package, then share the link

Codemaine commented 1 month ago

Sure. Here's the codesandbox link: https://codesandbox.io/p/devbox/mystifying-khorana-hhc69f?workspaceId=be20086d-945c-402b-ae8c-2b40ca5f7c9a

JaleelB commented 1 month ago

Sure. Here's the codesandbox link: https://codesandbox.io/p/devbox/mystifying-khorana-hhc69f?workspaceId=be20086d-945c-402b-ae8c-2b40ca5f7c9a

You aren't using the shadcn css variables in the environment. Make sure you're also using them in your project

Codemaine commented 1 month ago

I can confirm that I'm using the shadcn css variables in my project.

image
JaleelB commented 1 month ago

I can confirm that I'm using the shadcn css variables in my project.

image

@Codemaine Based on your first image, i think i know what the issue is. Do you have a live version of your app using the package? I dont think the min-width and height I included in the fix are being applied to the input in your use case. From what I can see the input is taking on the full width of the container. This is how it should be

Screenshot 2024-05-26 at 12 14 49 PM
JaleelB commented 1 month ago

@Codemaine Thanks. You can delete the comment now. I figured out what the issue is. Ypu are applying this min-width of 450px, which overrides the min-width that is set internally. That along with the w-full class causes the input to always be the size of the container so the tags are stacked above it. Remove that min-width and you should be fine. I see you also applying a shadow. If you just want the input to show without that outline also, just do shadow none. If you want to override the min-width, just bear in mind if you make it too large the tags will stack on top and no be inline depending on how big you make the parent container

Screenshot 2024-05-26 at 1 38 48 PM
JaleelB commented 1 month ago

@Codemaine I deleted the comment for you. Just follow what I said and you should be fine. Once that works, just close the issue as done

Codemaine commented 1 month ago

The min-width was from the demo on the landing page lmao. I removed the min-width and w-full classes, yet i'm still getting the styling issue.

JaleelB commented 1 month ago

The min-width was from the demo on the landing page lmao. I removed the min-width and w-full classes, yet i'm still getting the styling issue.

@Codemaine What exactly is the styling issue you're referring to then? I removed the "sm:min-w-[450px]" class from the input you showed and that solved the input not being inline. Is that not what you were referring to?

JaleelB commented 1 month ago

Also, update to the latest version of the package

Codemaine commented 1 month ago

Oh my bad. I thought the inline tags showed horizontally in the input field.