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

Font Names dropdown getting reset #4633

Open
6 tasks done
Rishitasharma2001 opened this issue Apr 30, 2024 · 4 comments
Open
6 tasks done

Font Names dropdown getting reset #4633

Rishitasharma2001 opened this issue Apr 30, 2024 · 4 comments

Comments

@Rishitasharma2001
Copy link

Checklist

  • I've looked at the documentation to make sure the behavior isn't documented and expected.
  • I'm sure this is an issue with Summernote, not with my app or other dependencies (Angular, Cordova, React, etc.).
  • I've searched through the current issues to make sure this hasn't been reported yet.
  • My issue is pertinent to this repository of Summernote (jQuery), or I was unable to have my issue resolved from the relevant version I'm using, such as Angular, dJango, Rails or React. Please try your issue at the relevent repository first.
  • I understand that issues without interaction for more than 14 days (2 weeks), may be closed at our discretion. We do this, as sometimes issues are abandoned. We may at our discretion, add issues to the relevant project to be looked at, or for maintainers to work through as time permits. This is to help keep issues relevant to the current version of Summernote, and to reduce clutter.
  • I agree to follow the Code of Conduct that this project adheres to.

Steps to reproduce

1: Select some font name from the dropdown in the toolbar.
2: Type one sentence.
3: If you go to a new line, sometimes the font name is getting reset to 'Helvetica' even when the user didn't change it from the dropdown

Expected behavior

Ideally, the font which the user selects from the dropdown should be retained until and unless user changes it again.

Current behavior

Font name is automatically getting set to 'Helvetica' sometimes if we go to a new line.

Minimal example reproducing the issue

No response

Environment

  • Summernote version:
  • Browser (with version):
  • OS/Platform (with version):
@1der1
Copy link

1der1 commented Apr 30, 2024

@Rishitasharma2001, can you give a reproducible example?

@Rishitasharma2001
Copy link
Author

If you see in the attached video I selected Arial Black as the font and if I move my cursor to 3rd or 4th line the font is getting reset to Helvetica Neue on its own. Ideally, until and unless user changes the font explicitly, it should stay as Arial black only (or whatever has been selected by the user). Don't move to 3rd or 4th line by pressing enter, bring the cursor instead there using keypad/mouse-click. If we move to the next line using enter, then font is getting retained.

summer.note.bug.mov

@1der1
Copy link

1der1 commented May 3, 2024

Thank you, @Rishitasharma2001.

I checked it and found that SN sometimes adds a new line (br tag) when you try to leave the edited area with the cursor:

The splitNode function calls the paddingBlankHTML function, which might add a blankHTML (<br>)

If the styling of the previous line is attached to a <br> instead of the parent element (usually a <p>), you add a piece of code without styling.

It is all related to emptyPara (<p><br></p>). SN depends on it, and there is a discussion: Do we still need emptyPara for focusing caret? #3016

@Rishitasharma2001
Copy link
Author

Thank you for the response @1der1 .
Don't you think this is some what inconsistent behaviour. A user can use cursor to get to the next line but then it would lose the selected font. Also, the same thing happens if you first choose the font-family and then the font-size then also you'll not be able to retain the selected font.

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