Skip to content

fix(editor): support Obsidian 1.15+ owner.syncScroll in embedded editors (#2761) - #2762

Merged
callumalpass merged 1 commit into
mainfrom
fix/2761-owner-syncscroll
Dec 1, 2026
Merged

callumalpass merged 1 commit into
mainfrom
fix/2761-owner-syncscroll

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Summary

  • Fixes Uncaught TypeError: this.owner.syncScroll is not a function in EmbeddableMarkdownEditor on Obsidian 1.15+.
  • Obsidian 1.15's ScrollableMarkdownEditor.handleScroll() calls this.owner.syncScroll() instead of the older this.owner.onMarkdownScroll(). Every embedded modal editor (Create Task NLP input, title, details, and Time Entry description) shares EmbeddableMarkdownEditor.
  • Updates both owner and activeEditorOwner in src/editor/EmbeddableMarkdownEditor.ts to provide no-op syncScroll, onMarkdownScroll, and showSearch methods alongside hoverPopover: null and a path getter, preserving compatibility with both Obsidian <= 1.14 and 1.15+.
  • Clears workspace.activeEditor in destroy() even if Obsidian's base focus listener assigned this.owner.
  • Updates MockScrollableMarkdownEditor so unit tests receive the real owner passed to super(...).
  • Adds unit (tests/unit/issues/issue-2761-owner-syncscroll.test.ts) and Obsidian 1.15.1 E2E (e2e/issues/issue-2761-owner-syncscroll.spec.ts) regression tests covering NLP (+, @, *), title, details, and time-entry editors.

Fixes #2761

Verification

  • Reproduced TypeError: this.owner.syncScroll is not a function on Obsidian 1.15.1 (public release v1.15.1) before the fix.
  • Verified after the fix on Obsidian 1.15.1:
    • e2e/issues/issue-2761-owner-syncscroll.spec.ts (2 passed)
    • e2e/task-modal-editors.spec.ts (5 passed)
    • e2e/issues/issue-2404-nlp-enter-save.spec.ts (4 passed)
  • Verified locally with npm run build, npm run check:bundle-size, npm run lint:css:dist, npm run typecheck, npm run lint, and npm test (866 suites / 6,750 tests passed).

@callumalpass
callumalpass merged commit 0f9e9f9 into main Dec 1, 2026
3 checks passed
@callumalpass
callumalpass deleted the fix/2761-owner-syncscroll branch December 1, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant