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(