From 45a9597f7fc45e696b401d89d21907cb7db36fbc Mon Sep 17 00:00:00 2001 From: X Code Date: Mon, 31 Jan 2022 00:22:01 -0800 Subject: [PATCH] Update _handleCheckboxTap --- lib/src/widgets/raw_editor.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/widgets/raw_editor.dart b/lib/src/widgets/raw_editor.dart index f9dcbde4..d1d2a6d7 100644 --- a/lib/src/widgets/raw_editor.dart +++ b/lib/src/widgets/raw_editor.dart @@ -407,6 +407,8 @@ class RawEditorState extends EditorState _disableScrollControllerAnimateOnce = true; final attribute = value ? Attribute.checked : Attribute.unchecked; + widget.controller.formatText(offset, 0, attribute); + // Checkbox tapping causes controller.selection to go to offset 0 // Stop toggling those two toolbar buttons widget.controller.toolbarButtonToggler = { @@ -414,8 +416,6 @@ class RawEditorState extends EditorState Attribute.header.key: Attribute.header }; - widget.controller.formatText(offset, 0, attribute); - // Go back from offset 0 to current selection SchedulerBinding.instance!.addPostFrameCallback((_) { widget.controller.updateSelection(