Update _handleCheckboxTap

pull/635/head
X Code 3 years ago
parent 3253a3c0f8
commit 45a9597f7f
  1. 4
      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(

Loading…
Cancel
Save