Setting font color or background color causes an error when pressing Enter.
Is there an existing issue for this?
- [X] I have searched the existing issues
Flutter Quill version
No response
Steps to reproduce
As mentioned in the title, pressing Enter after setting the color without entering any content will cause an error. Please check the video.
https://github.com/user-attachments/assets/67707e8c-f1ca-4d1e-bcc2-60f0cea3ccd7
Expected results
After pressing Enter multiple times, I hope to clear the formatting.
Actual results
Restarted application in 1,257ms.
════════ Exception caught by services library ══════════════════════════════════ The following assertion was thrown during method call TextInputClient.updateEditingState: It is not allowed to apply inline attributes to line itself. 'package:flutter_quill/src/document/nodes/line.dart': Failed assertion: line 140 pos 11: 'style.values.every((attr) => attr.scope == AttributeScope.block || attr.scope == AttributeScope.ignore)'
When the exception was thrown, this was the stack:
#2 Line.retain (package:flutter_quill/src/document/nodes/line.dart:140:11)
#3 QuillContainer.retain (package:flutter_quill/src/document/nodes/container.dart:162:17)
#4 Document.compose (package:flutter_quill/src/document/document.dart:415:15)
#5 QuillController.replaceText (package:flutter_quill/src/controller/quill_controller.dart:327:18)
#6 RawEditorStateTextInputClientMixin.updateEditingValue (package:flutter_quill/src/editor/raw_editor/raw_editor_state_text_input_client_mixin.dart:241:25)
#7 TextInput._updateEditingValue (package:flutter/src/services/text_input.dart:2067:43)
#8 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1903:29)
#9 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1803:20)
#10 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:571:55)
#11 MethodChannel.setMethodCallHandler.
call: MethodCall(TextInputClient.updateEditingState, [3, {selectionBase: 1, composingExtent: -1, selectionAffinity: TextAffinity.downstream, text:
, selectionIsDirectional: false, selectionExtent: 1, composingBase: -1}]) ════════════════════════════════════════════════════════════════════════════════
Additional Context
Screenshots / Video demonstration
[Upload media here]
Logs
[Paste your logs here]
Which version are you using of Flutter Quill? It seems like another issue that was fixed.
V 10.7.3 ---- Replied Message ---- | From | @.> | | Date | 09/21/2024 23:24 | | To | singerdmx/flutter-quill @.> | | Cc | lingyun000 @.>, Author @.> | | Subject | Re: [singerdmx/flutter-quill] Setting font color or background color causes an error when pressing Enter. (Issue #2261) |
Which version are you using? It seems like another issue that was fixed.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
V 10.7.3
Thanks for reporting it. When i have time i will take a look what could be happening.
The same thing. If I tap"enter" with an empty string, inside the library works method "retain" from the document\line.dart. Inside, you do the check for attributes. If some of them are "inline" you do assert.
Please, can you update to the v11.0.0 and check if the issue persists?
It is a challenge. I tried to do it, but I have my custom toolbar, and it is real headache.
There's not much i can do in this case. If the bug persists in the current version, i might be able to help you, but we can't do much when the bugs come from older versions than the ones we're supporting. I strongly recommend that you upgrade to the latest version of Flutter Quill and if this bug still persists, reopen this issue.