[Bug] Settings: Wrong navigation depth after calling update()

I am not entirely sure if this topic is correct. The bug will appear for everyone, but the declarative settings API is still very new and the official settings don’t use lists, so I guess only developers will stumble upon it for now.

Steps to reproduce

  1. Open a settings tab containing a list of pages (use example code below)
    1. Create PluginSettingTab
    2. Using the declarative settings API create:
      1. a list
      2. items of type page
      3. some trigger on the main settings page to call update()
    3. compile → run → open settings tab
  2. trigger update()
  3. Click on a sub page
  4. navigate back

Did you follow the troubleshooting guide? [Y/N]

Yes.

Expected result

I would expect to land on the main settings tab.

Actual result

I see the same sub page again and need to navigate back a second time to reach the main settings page again.

Environment

SYSTEM INFO:
	Obsidian version: 1.13.1
	Installer version: 1.8.7
	Operating system: Windows 11 Home 10.0.26200
	Login status: logged in
	Language: en
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 1
		1: My Plugin v0.0.0

Additional information

  • It seems like instead of navigating to /Sub page 1 the app navigates to /Sub Page 1/Sub Page 1
  • After clicking on the sub page (step 3) the double navigation can also be seen in the animation
  • It only happens for the first navigation after update()
  • It doensn’t seem to matter which sub page is clicked or if it was clicked before
  • The docs contradict themselves, if calling update()while the settings are open, is a safe action
    • It is presented as a recommended solution here:

      If what your tab displays depends on state that changes elsewhere […], the tab can go stale while the user has it open. Call this.update() to re-run getSettingDefinitions() and rebuild.

    • It is implied to be unsafe here:

      update() is safe to call when the settings modal is closed

    • Anyway I see no other way to add, rename and remove sub pages, without calling update()

  • It’s kind of related to another post of mine: https://forum.obsidian.md/t/how-to-properly-rename-lists-of-sub-pages-in-a-seettings-tab/115339?u=resource1909

Example code

import { Plugin, PluginSettingTab, SettingDefinitionItem } from "obsidian";

export class ExampleSettingsTab extends PluginSettingTab {
	constructor(plugin: Plugin) {
		super(plugin.app, plugin);
	}

	getSettingDefinitions(): SettingDefinitionItem[] {
		return [
			{
				type: "list",
				heading: 'Sub pages',
				items: [
					{
						type: "page",
						name: "Sub page 1",
						searchable: true,
						items: [ { name: "Test" } ]
					},
					{
						type: "page",
						name: "Sub page 2",
						searchable: true,
						items: [ { name: "Test" } ]
					}
				]
			},
			{
				name: "Trigger Update",
				action: () => this.update()
			}
		];
	}
}

Gif

2026-06-29 Obsidian Bug Update Sub Pages

Funny thing I just realised: It stacks! For each call to update()the next navigation gets one extra depth.