From bb954f85f15b0357d4929fa2584aff5c2834e7bc Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 6 Nov 2022 11:24:20 +0100 Subject: [PATCH] neon: Fix cursor still doing stuff when note is updated --- .../neon/lib/src/apps/notes/pages/note.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/neon/lib/src/apps/notes/pages/note.dart b/packages/neon/lib/src/apps/notes/pages/note.dart index 5b0b283b..2b91af83 100644 --- a/packages/neon/lib/src/apps/notes/pages/note.dart +++ b/packages/neon/lib/src/apps/notes/pages/note.dart @@ -54,14 +54,21 @@ class _NotesNotePageState extends State { }); widget.bloc.content.listen((final content) { - final selection = _contentController.selection; - _contentController - ..text = content - ..selection = selection; + if (_contentController.text != content) { + final selection = _contentController.selection; + _contentController + ..text = content + ..selection = selection; + } }); widget.bloc.title.listen((final title) { - _titleController.text = title; + if (_titleController.text != title) { + final selection = _titleController.selection; + _titleController + ..text = title + ..selection = selection; + } }); _contentController.addListener(() => _updateController.add(null));