We just use CSS to make it sticky (though in older browsers it's a JS based solution).
But essentially, it is possible for a screenshot tool to be a bit clever and reset the CSS it detects might cause this effect, though I guess not everyone takes that approach. But either way it would be down to the screenshot tool to implement that, like Chrome has.