Added better fix for preview scroll

improved the synchronization between the editor and the preview panel