Comments (9)
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.
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:
Font Awesome page: https://fontawesome.com/icons/question-circle?style=regular
from react-rating.
@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.
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.
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.
@dreyescat I've written a proposed solution, but I dont have permissions to push a branch to make a PR.
from react-rating.
Mmm... Where are you trying to push? Did you fork this repo first?
Usually what you should do is:
- Fork the repo
- Add changes (feature, fix, whatever you consider). Commit and push to your forked repo.
- Make a pull request
Some helpful links:
Hope it helps!
from react-rating.
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.
Summing up:
emptySymbol
is hidden only when it is a non-fractional rating.emptySymbol
is kept as background of thefullSymbol
otherwise.
from react-rating.
Related Issues (20)
- Initial Rating returns null only renders once
- on version 2.0.1 ReactRating-component onChange-event seems to return always value of initialRating HOT 15
- Error during installation on jenkins HOT 2
- Cannot read property 'type' of undefined
- Method comments are switched HOT 1
- Misalignment HOT 4
- Sorry HOT 1
- All touches, even scroll/swipe gestures trigger "onClick" HOT 8
- Warning: Using UNSAFE_componentWillReceiveProps in strict mode is HOT 10
- Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. HOT 5
- Feature request: Lighter DOM Size HOT 1
- Doesn't work with react 17 HOT 1
- Selection requires double click if onClick method provided HOT 3
- How to add the validation for the rating component HOT 1
- Add option to remove default style
- mixed symbol but react component HOT 1
- Package should be marked as deprecated and a replacement fork nominated HOT 2
- React 18: TS2786: 'Rating' cannot be used as a JSX component. HOT 9
- `@types` dependencies should be in `devDependencies`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-rating.