Opening a file in preview mode and then switching to edit mode scrolls to top of file

Steps to reproduce

  1. Enter preview mode
  2. Open a file that is long enough to cause vertical scroll (you must be in preview mode before opening the file)
  3. Scroll to the bottom of the file
  4. Switch to edit mode

Expected result

I enter edit mode in the section of the file that I am currently viewing.

Actual result

The editor scrolls to the top of the file, causing me to lose my place and have to scroll back down to the part of the file I was trying to edit.


	Obsidian version: v1.1.16
	Installer version: v0.15.8
	Operating system: Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 22.4.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on


Additional information

Screen recording: obsidian

Interestingly, this only happens the first time that I switch to edit mode in a file. If I am in preview, open a file, switch to edit mode, switch to preview, scroll down, then switch to edit again, I get the expected behavior the second time (the editor opens at the part of the file I’m viewing instead of scrolling to the top).

I found found two potential duplicate bug reports for this, but both were dismissed as being caused by plugins or third party themes. However, I was able to reproduce this in the sandbox vault without changing any settings.