Make affix accept `0` as offsetTop or offsetBottom

Fixes #12815.
Closes #14363.