react-overlays
react-overlays copied to clipboard
offsetBottom doesn't appear to work with AutoAffix component?
This appears to be working correctly with the Affix tag, but the AutoAffix tag doesn't properly stop affixing X pixels from the bottom.
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; }
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.
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.
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.
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?