Skip to content

fix: TocContoller.jumpToIndex stop working if MarkdoThewnWidget instance is replaced#1

Merged
heyteacher merged 1 commit into
mainfrom
remove-TocController.jumpToWidgetIndexCallback-unset-on-MarkdownWidgetState.dispose
Feb 3, 2026
Merged

fix: TocContoller.jumpToIndex stop working if MarkdoThewnWidget instance is replaced#1
heyteacher merged 1 commit into
mainfrom
remove-TocController.jumpToWidgetIndexCallback-unset-on-MarkdownWidgetState.dispose

Conversation

@heyteacher
Copy link
Copy Markdown
Owner

Removed TocContoller.jumpToWidgetIndexCallback unset on MarkdownWidgetState.dispose and add isDisposed check on jumpToWidgetIndexCallback implementation.

This avoid TocContoller stop working if MarkdownWidget is replaced by a new instance and old instance is disposed.

This happens for example in adaptive layouts implementation or multi language support, when MarkdoThewnWidget is replaced but TocContoller remain the same.

The isDisposed check preserve jumpToWidgetIndexCallback invocation after the MarkdoThewnWidget is disposed,

…State.dispose and add isDisposed check on jumpToWidgetIndexCallback implementation
@heyteacher heyteacher self-assigned this Feb 3, 2026
@heyteacher heyteacher added the bug Something isn't working label Feb 3, 2026
@heyteacher heyteacher merged commit a844ca4 into main Feb 3, 2026
@heyteacher heyteacher deleted the remove-TocController.jumpToWidgetIndexCallback-unset-on-MarkdownWidgetState.dispose branch February 3, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant