singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.49k stars 795 forks source link

Pre-defined text styles are gone when i press enter key only in ios. #1921

Closed tom0916-cha closed 1 month ago

tom0916-cha commented 2 months ago

Is there an existing issue for this?

Flutter Quill version

flutter_quill: ^9.4.1

Steps to reproduce

  1. I select defined custom text and font size from menu
  2. I changed the language to a Korean keyboard and pressed the Enter key.
  3. I pressed enter key at the end of line.
  4. The style and font size I set are gone only in IOS. pretty good on MacOS, Android

Expected results

When you press enter at the end of the sentence, the existing font and font size do not change.

Actual results

The style and font size I set are gone only in IOS. pretty good on MacOS, Android

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

lutter: ChangeSource.local:insert⟨ 06 ⟩ + {size: 26.0, color: #FF42A5F5, bold: true} insert⟨ 월17일 ⟩ + {size: 13.0, color: #FF42A5F5} insert⟨ ⏎ ⟩ insert⟨ 오늘하루는 어떠셨나요? ⟩ + {font: MiSaeng, size: 22.0} insert⟨ ⏎어⏎ ⟩ flutter: event.change:떠 flutter: insert⟨ 떠 ⟩

AtlasAutocode commented 1 month ago

Can you try version 9.5.7 to see if this has been fixed. Can you also try using english so we can see if the problem is with styles or language.

AtlasAutocode commented 1 month ago

I do not know what the significance of this is but:

Using the FQ Example app and selecting 'Empty'. I typed in some text, and then pasted in: 월17일 (copied from OP example above). It crashed with an assertion in font.dart because the fontsize was '14px' which is not a double or int as expected but a string that could not be parsed to double.

This appears to be an effect of pasting HTML text as the same characters pasted from windows notepad (plain text editor) do not crash. As our expert on html - can you look into this? Does this explain this current issue?

I also note @Alspb has asked for "Paste as plain text" - I may have to add a trap for an exception with failsafe to paste as plain. Or update the code to recognize 'px'.

tom0916-cha commented 1 month ago

flutter_quill 9.5.14

Can you try version 9.5.7 to see if this has been fixed. Can you also try using english so we can see if the problem is with styles or language.

When I select a font and enter text, the designated font disappears. The same applies to typing in English or Korean. After entering the text, select the text to change the font of the text The font style remains unchanged and continues.

AtlasAutocode commented 1 month ago

I can't reproduce this using an iOS simulator. I entered some text, changed the font and entered more text, pressed enter - displayed fonts were as expected. I selected a word and changed its font - display was as expected. The only observation is that if you select a font and press enter the font will be lost since you did not enter any text. I repeated using font size and had no problems. I repeated using header styles and had no problem.

  1. Could there be something in your iOS device that is causing the problem?
  2. Do you get the same result when using attributes like bold?
  3. Are you sure your iOS device supports the font you are selecting?
AtlasAutocode commented 1 month ago

Any update? Has this been resolved or is there still an issue?

AtlasAutocode commented 1 month ago

Cannot reproduce.