Skip to content

settings-modal

Helpers for Obsidian’s Settings modal.

Interface Description
OpenSettingTabParams Parameters for openSettingTab.
Function Description
openSettingTab Opens Settings on a tab, without opening that tab a second time when it is already the active one. Opening a tab hides the active tab and renders the new one, so opening the tab that is already shown runs its display() again for nothing, and a tab whose mount logic does not expect that can break. Settings re-opens its last tab by itself when it opens on desktop and tablet, but not on a phone, where it shows the tab list instead. So the check is on the tab that is active after Settings opened, not on the last tab id, which on a phone would leave the user on the list.