fkhadra / react-on-screen

Check if a react component in the viewport
https://fkhadra.github.io/react-on-screen/
MIT License
405 stars 50 forks source link

Ability to specify the wrapping element other than DIV #31

Closed dakujem closed 5 years ago

dakujem commented 6 years ago

It would be awesome if I was able to specify what wrapper element is used. I want to use this to track visibility of rows in a table, which is not possible this way, as invalid HTML markup is created:

<tr>
  <div>
    <td>C</td>
    <td>Other Business</td>
  </div>
</tr>

If there is any dirty workaround, let me know as well please.

fkhadra commented 6 years ago

Hello @dakujem,

This feature is not implemented. I need to free up times to work on it. PR are welcome BTW. It should be easy to implement.

dakujem commented 6 years ago

I'd gladly help, but I don't understand react (well the whole js/npm ecosystem) that much. But I may try.

kafein commented 6 years ago

Hi. Just made a pull request for this feature.

dakujem commented 6 years ago

32

fkhadra commented 5 years ago

Merged