You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prevents the editor from updating its cursor/focus when the document changes. You can work around it by briefly resetting that flag around your format call, then re-focusing the editor:
QuillToolbarToggleStyleButton(
options:QuillToolbarToggleStyleButtonOptions(
afterButtonPressed: () async {
// 1. Temporarily re-enable focus updates
quillController.ignoreFocusOnTextChange =false;
// 2. Apply the style toggle (e.g. Bold/Unbold)
quillController.formatSelection(Attribute.bold);
// 3. Re-focus the editor so the cursor moves correctly
quillFocusNode.requestFocus();
// 4. (Optional) Re-disable focus updates after the frameWidgetsBinding.instance.addPostFrameCallback((_) {
quillController.ignoreFocusOnTextChange =true;
});
},
),
controller: quillController,
attribute:Attribute.bold,
),
Why this helps:
Step 1 lets the controller handle the text change and move the cursor as usual.
Step 3 ensures the editor regains focus immediately.
Step 4 restores ignoreFocusOnTextChange (if you still need it to suppress unwanted scroll jumps on subsequent edits).
If you’d rather avoid the post-frame callback, you can also re-enable the ignore flag with a short Future.delayed(Duration.zero, () { ... }); instead of addPostFrameCallback. Let me know if this solves the issue or if you need a more integrated fix!
Have you checked for an existing issue?
Flutter Quill Version
11.2.0
Steps to Reproduce
After press, Try selecting text multiple times or move the cursor.
Expected results
Cursor should behave normally after toggling toolbar actions
Text should be selectable and cursor should be moveable
Actual results
After pressing a toolbar button (like Bold), cursor stops responding
Unable to select text or move the cursor properly,
if we press backbutton, then text selection appear,
Additional Context
The text was updated successfully, but these errors were encountered: