react-overlays icon indicating copy to clipboard operation
react-overlays copied to clipboard

offsetBottom doesn't appear to work with AutoAffix component?

Open CoreyDH opened this issue 8 years ago • 5 comments

This appears to be working correctly with the Affix tag, but the AutoAffix tag doesn't properly stop affixing X pixels from the bottom.

CoreyDH avatar Jul 06 '17 21:07 CoreyDH

I found a fix to this issue actually if someone wants to test it.

In the AutoAffix.js file, after line 124 where it says: offsetBottom = documentHeight - top - height;

I simply added.. if(this.props.offsetBottom) { offsetBottom += this.props.offsetBottom; }

CoreyDH avatar Jul 06 '17 21:07 CoreyDH

Hmm, is it supposed to be supported there? What does setting offsetBottom do here?

I think this might have been an oversight on my part in forgetting to delete the prop types, and their ending up in the automatically generated documentation by mistake.

Naively, this API doesn't seem to naturally "take" additional offset fields, since you want to make the affix seem like it's "contained" in another element.

taion avatar Sep 13 '17 03:09 taion

I also have this problem. I don't really understand the AutoAffix. It's lacking in documentation. What are "many common cases"?

In my case Affix doesn't work as expected (the width of the component is incorrect) and the AutoAffix works good except for the offset from bottom.

rikas avatar Sep 22 '17 16:09 rikas

The point of <AutoAffix> is if you want to make an affix "seem" like it's contained in another container div, as opposed to calculating the offsets yourself.

taion avatar Oct 19 '17 23:10 taion

Okay, I see, you mean offsetBottom as in the offset from the bottom of the element when sticked. That makes sense. Care to submit a quick PR to fix?

taion avatar Oct 19 '17 23:10 taion