Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All font settings are lost when you press Enter twice #1969

Closed
1 task done
geronimol opened this issue Jul 4, 2024 · 7 comments · Fixed by #1980
Closed
1 task done

All font settings are lost when you press Enter twice #1969

geronimol opened this issue Jul 4, 2024 · 7 comments · Fixed by #1980
Labels
bug Something isn't working

Comments

@geronimol
Copy link
Contributor

geronimol commented Jul 4, 2024

Is there an existing issue for this?

Flutter Quill version

9.5.3

Steps to reproduce

Captura de pantalla 2024-07-04 a la(s) 17 42 53

Related issue: #1951

Expected results

Keep font family and font size after pressing Enter twice

Actual results

Font family and font size settings are lost pressing Enter twice

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

Captura de pantalla 2024-07-04 a la(s) 16 14 40

Logs

Logs
[Paste your logs here]
@geronimol geronimol added the bug Something isn't working label Jul 4, 2024
@AtlasAutocode
Copy link
Collaborator

This is being worked on, but it is more complex than simply pressing enter twice.

To give you an example:

  1. Type text with bold, press enter twice and enter more text - more text is correctly entered as bold.
  2. Next, type text with bold, press enter twice then press the Up-arrow key and enter more text - more text is NOT entered as bold.

Font and size are treated as inline styles but were not listed in Attribute.inlineKeys. This needs review of Attributes in general.

The problem is in PreserveInlineStylesRule which has a complex interaction between inline and block styles. (see issue 1940)

@EchoEllet
Copy link
Collaborator

#1119 could be related.

@AtlasAutocode
Copy link
Collaborator

Yes, it is related.
The whole business of preserving inline styles is much more complex than I thought it would be.
I have resolved the business of inline styles being maintained when pressing enter (1-many times) but found the styles were lost when you pressed the up-arrow key.

For this issue, I found that font and size were not listed as inline styles. I have fixed this and added tests to ensure the Attribute class collections of keys is updated if new attributes are added in the future (current proposal to add an attribute for linespacing?)

#1940 has reported a problem with maintaining inline styles while entering lists or codeblocks. I think I have fixed this as well.

The problem that is still open is editing links. If you click within a link and enter text, the inserted text is inserted as plain text flanked by underscored links. I would think the intent is to edit the visible text for the link rather than splitting the link into 2 parts with plain text?

@ellet0 do you recommend submitting what is done ASAP and worry about what is not fixed later?

@EchoEllet
Copy link
Collaborator

@ellet0 do you recommend submitting what is done ASAP and worry about what is not fixed later?

I recommend releasing changes that fix a bug and cause another as an alpha or experimental version (pub.dev pre-release). Though we no longer maintain the dev branch, you also mentioned it's a partial fix for a more complex bug, so I would suggest submitting what has been fixed for now and taking care of the rest later.

@AtlasAutocode
Copy link
Collaborator

Thanks for your advice.
Have submitted the PR.

@EchoEllet
Copy link
Collaborator

Thanks for your advice.
Have submitted the PR.

Thank you for your contributions.

@geronimol
Copy link
Contributor Author

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants