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

Why is the text formatting not persisted on the following lines? #4383

Open
dumitrascuSorin opened this issue Aug 21, 2024 · 3 comments
Open

Comments

@dumitrascuSorin
Copy link

dumitrascuSorin commented Aug 21, 2024

Steps for Reproduction

  1. Run the 'Custom font and formats' example from the playground
  2. Delete the existing text and change the font family from 'Aref Ruqaa' to 'Roboto'
  3. Adding a new line of text will reset the selected font from the previously selected 'Roboto' to 'Aref Ruqaa'

Expected behavior:
I am expecting that the selected font will be persisted and not reset to the default one every time the user adds a new line.
This was the behavior Quill v1.3.7 used to have and no breaking change warning has been added in Quill v2 release notes.

Actual behavior:
The selected font is reset to the default one.

Platforms:

Include browser, operating system and respective versions

Version:
v2.0.2

@dumitrascuSorin dumitrascuSorin changed the title Why is the font selection not persisted on the following lines? Why is the text formatting not persisted on the following lines? Aug 22, 2024
@gjulivan
Copy link

gjulivan commented Sep 6, 2024

this issue is also occurs on other similar formatting such as: bold, italic, superscript, etc..
it is not persisted on new line entry

@dumitrascuSorin
Copy link
Author

@gjulivan
It seems this was done on purpose in Quill v2 and they didn't mark it as a breaking change. The behaviour was changed in pull request #3428
To get it working as it used to in Quill v 1.3.7, I did the following (note that my project is using ngx-quill, which is an Angular wrapper for Quill)

  • I used the onEditorCreated event handler to get all the keyboard bindings associated with the Enter key
  • I looped over the Enter bindings and removed the default empty binding and the handleEnter binding.
  • I added a new Enter key binding which contains the old handleEnter logic which was changed in the abovementioned pull request.
    Hope this helps!

@gjulivan
Copy link

gjulivan commented Sep 6, 2024

thanks for the PR, I see that the changes occurs on keyboard module,
i'll try to simply extend and override the module first.
@dumitrascuSorin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants