Make sure element is on page before we scroll to it

Could be bug with contains selector....