Make scrollIntoView work properly when called inside an operation

Closes #1398