Coder Social home page Coder Social logo

Comments (9)

dreyescat avatar dreyescat commented on July 17, 2024

Hi @jamesw6811!

Yes, you are right. The emptySymbol elements are always there. They are not removed. They are just covered by the fullSymbol elements.

If I am not wrong your issue is that your fullSymbol is not big enough to completely cover the underlying emtpySymbol, and then you see the empty symbol under the filled symbols, right? I would just make them, the empty and the full symbol, the same size.

from react-rating.

jamesw6811 avatar jamesw6811 commented on July 17, 2024

Thanks for the quick reply @dreyescat ! I'm using the Font Awesome pack, and for some icons in that pack the "full" variants don't mesh well on top of the non-full. Maybe it would be beneficial feature to have a toggle for replacing instead of covering?

For example, here is the Font Awesome question mark circle:

emptySymbol={<i className="far fa-question-circle fa-2x"></i>}
fullSymbol={<i className="fas fa-question-circle fa-2x"></i>}

Here is the result when selected:
image

Font Awesome page: https://fontawesome.com/icons/question-circle?style=regular

from react-rating.

jamesw6811 avatar jamesw6811 commented on July 17, 2024

@dreyescat I'm very new to contributing to open-source, but I'm also happy to try submitting a PR for this change - the least i could do for the value I've gotten out of it.

from react-rating.

dreyescat avatar dreyescat commented on July 17, 2024

I am always open to contributions, of any kind of expertise 👍. So if you feel that you have something to contribute, yep, go ahead and open a PR. Even more, I encourage you to do it 😉 . I will try to guide you to my best on the process. However I do not promise you it is going to be merged until we see it fits. For example, I am reluctant to adding new properties, but maybe, only rendering the required symbols would be something to be considered...

BTW, as a workaround you can try adding a solid background to your full symbol to try to cover the underlying empty symbol. Something like this:

fullSymbol={<i style={{backgroundColor: 'white'}} className="fas fa-question-circle fa-2x"></i>}

from react-rating.

jamesw6811 avatar jamesw6811 commented on July 17, 2024

Thanks! I think it could be very useful for some rating icons - not just my example, but also semi-animated ratings. For example, I've seen some rating bars that are a fist until you select them, then they turn into a thumbs up.

from react-rating.

jamesw6811 avatar jamesw6811 commented on July 17, 2024

@dreyescat I've written a proposed solution, but I dont have permissions to push a branch to make a PR.

from react-rating.

dreyescat avatar dreyescat commented on July 17, 2024

Mmm... Where are you trying to push? Did you fork this repo first?

Usually what you should do is:

  1. Fork the repo
  2. Add changes (feature, fix, whatever you consider). Commit and push to your forked repo.
  3. Make a pull request

Some helpful links:

Hope it helps!

from react-rating.

jamesw6811 avatar jamesw6811 commented on July 17, 2024

Thanks! Like I said - brand new. I've only worked in private collaborative Git repos where everyone has branch access.

It helps a lot!

from react-rating.

dreyescat avatar dreyescat commented on July 17, 2024

Summing up:

  • emptySymbol is hidden only when it is a non-fractional rating.
  • emptySymbol is kept as background of the fullSymbol otherwise.

from react-rating.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.