gm0t / react-sticky-el

MIT License
257 stars 47 forks source link

Issues with links and clickable elements #13

Open aihkas opened 7 years ago

aihkas commented 7 years ago

While in use with a table of contents element, links became unclickable, I was able to get over that issue by adding stickyClassName with a high z-index. but the issue persists when the element is not floating, and applying a className doesn't seem to solve it. Thanks for the effort with this module, I'll try to debug when I have the time to make a pull request. Here's an example snippet of my code:

            <Sticky hideOnBoundaryHit={ false }
              boundaryElement={ '#container' }
               positionRecheckInterval={ 1 }
                 stickyClassName={s.sticky}
                  className={ s.sticky }
                  topOffset={ 70 }
                  >
            <ul className={ s.cd_faq_categories } >
              <li className={ s.link }>
                <a href="#basics">
                  Link
                </a>
              </li>
            </ul>
          </Sticky>
aihkas commented 7 years ago

The issue is caused by this div: <div style="min-height: 0px;"> Which contains the sticky element.

gm0t commented 7 years ago

HI @aihkas, if you give me an example (plunker, jsfiddle, codepen... ) I'll try to help you. Because right now, I'm not sure how to reproduce this issue

stahlmanDesign commented 3 years ago

I also have this problem when a context menu is in the sticky zone. Normal buttons work, but not this library which supports touch events and is not triggered by a click like buttons are https://github.com/vkbansal/react-contextmenu/blob/master/docs/api.md

When I toggled off the sticky el my context menu works.

Will look into it more.