soundar24 / roundSlider

roundSlider - A free jQuery plugin
https://roundsliderui.com/
MIT License
267 stars 80 forks source link

Clickable Tooltip for react component. #93

Closed aaron170 closed 4 years ago

aaron170 commented 5 years ago

Is there a way we can click a tooltip and call a function.

This is my code.

https://stackblitz.com/edit/react-roundslider

I am trying to change values on the tootltip given. If i click on Inactive Tooltip the value should change to 46 for Inactive.

Please help. Thanks

soundar24 commented 5 years ago

Actually you are using the plain HTML as the tooltip content, so it won't act as jsx. Also u can't use the react methods inside that, so you can call the javascript functions only at this case. That function should be placed in the current scope or global scope.

Check the below demo: https://stackblitz.com/edit/react-roundslider-djdphy

aaron170 commented 5 years ago

Thanks a lot @soundar24 ... Thats great. I had placed a clickable function inside ComponentDidMount. That also worked but I guess your solution is much better as I can call single function to all the value changes.

Thanks