cht8687 / react-hover

React hover --- make hover easy http://cht8687.github.io/react-hover/example/
MIT License
107 stars 25 forks source link

Update ReactHover.js #19

Closed roczki93 closed 5 years ago

roczki93 commented 6 years ago

Added new CSS property in hover container. I added z-index property to show on front site content in hover. I had a problem with text in background. The background text was over the content of the balloon - this change fixed them.

cht8687 commented 6 years ago

thanks for the change @roczki93

cht8687 commented 6 years ago

Hi @roczki93 I am just wondering, why don't you configure the zIndex css in your hover component? something like here: https://github.com/cht8687/react-hover/blob/master/src/example/Example.js#L62 in this way, zIndex is not tied with fix number, so people can change it according to fit their need.

roczki93 commented 6 years ago

Hi cht8687, I would like to show you my principle: ` <==HERE I NEED A CUSTOM Z-INDEX

<==THIS DIV Albert Einstein
Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

--Albert Einstein

            </ReactHover.Hover>
          </ReactHover>`

I don't know how can I add in this place a custom styles. Please tell me, this is possible? When I changed styles in "THIS DIV" z-index doesn't work. Thanks for your time, have a nice day!

cht8687 commented 6 years ago

@roczki93 So you'd like a custom z-index for:

 <div className={componentstyles.hover} > 

right? so you can add the zIndex to .hover class which is here: https://github.com/cht8687/react-hover/blob/master/src/example/component.css and import it like in the example then apply it to this div. className={componentstyles.hover}

Let me know if there is any misunderstood. cheers

cht8687 commented 5 years ago

closing this PR. @roczki93 let me know if further work required we can reopen again.