Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stars appearing vertically #53

Open
HarkiratShopism1 opened this issue Nov 7, 2023 · 14 comments
Open

Stars appearing vertically #53

HarkiratShopism1 opened this issue Nov 7, 2023 · 14 comments

Comments

@HarkiratShopism1
Copy link

I am using tailwind css in my project and after I installed tailwind I am experiencing a vertical alignment of stars

Can someone help me sort this out.

@baydisng13
Copy link

I am also facing the same issue in my Next.js and Tailwind projects.
image
when I pass the props emptyClassName="flex" no change but
when I pass the props emptyStyle={{display:"flex"}} will render horizontally but not function as it should be
Specifically, even if I select multiple stars, only the first star shows as filled. See the screenshot below for an example where I selected 4 stars but only the first star is filled:
image

@henaorth16
Copy link

Make the wrapper div flex flex-col h-auto

@HarkiratShopism1
Copy link
Author

HarkiratShopism1 commented Nov 8, 2023

Make the wrapper div flex flex-col h-auto
I tried to implement the above mentioned suggestion the stars are aligned horizontally after implementing but when I try to select multiple stars, only the first star shows as filled.

@Tallal64
Copy link

@baydisng13 pass the prop "SVGclassName={inline-block}" instead of "emptyStyle={{display:"flex"}}" and hopefully it will fix the problem.

real

@m-lyon
Copy link

m-lyon commented Jan 6, 2024

@Tallal64 this does not resolve the issue for me. Instead, i set SVGstyle={{ display: 'inline-block' }} which resolved the issue.

@undermad
Copy link

undermad commented Feb 11, 2024

Hey, That works for me

<Rating
            SVGclassName={'inline-block'}
            initialValue={4}
            readonly={true}/>

@zaadevofc
Copy link

I am also facing the same issue in my Next.js and Tailwind projects. image when I pass the props emptyClassName="flex" no change but when I pass the props emptyStyle={{display:"flex"}} will render horizontally but not function as it should be Specifically, even if I select multiple stars, only the first star shows as filled. See the screenshot below for an example where I selected 4 stars but only the first star is filled: image

thanks its work for me

@KhaliLounis
Copy link

none of the fixes above worked for me anything new ?

@agusdwimilniadi
Copy link

none of the fixes above worked for me anything new ? i worked with #53 (comment)

@pantharshit007
Copy link

Explanation of how problem is getting solved:

I spent some time twerking in dev tools on the browser, and that's when I found this:

image
and changing here block to inline fixed the problem now all that's left is to check how to change SVG class properties which you can find in the Rating.d.ts file.

image
and after that when I checked the issue @Tallal64 already fixed that.

thanks, mate

image

@jkmuku
Copy link

jkmuku commented Aug 28, 2024

The above solutions don't work when using custom icon

@jack-song
Copy link

jack-song commented Sep 22, 2024

The above solutions don't work when using custom icon

@jkmuku dunno if you figured this out, but on my custom icon i just set inline-block directly in the icon component and it works

@akarshshri
Copy link

I'm using version 5.1.7.

Okay so none of the above solution worked. Passing emptyStyle={{display:"flex"}} as prop worked but filling the star was only working for 1 star.

Next solution, passing SVGclassName={inline-block} as a prop didn't working. I was getting error in typescript.
I'm finally able to solve this issue by manually overriding the css.

.react-simple-star-rating :where(img, svg, video, canvas, audio, iframe, embed, object){
    display: inline !important;
}

@Smartech-git
Copy link

@baydisng13 pass the prop "SVGclassName={inline-block}" instead of "emptyStyle={{display:"flex"}}" and hopefully it will fix the problem.

real

This worked for me 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests