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

Selecting the content by triple click and apply ul/ol or paragraph alignments, style applied to content below as well #4619

Open
6 tasks done
GuruSireeshaP opened this issue Mar 8, 2024 · 4 comments

Comments

@GuruSireeshaP
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 content which more than one word by clicking 3 times(selecting an entire paragraph using triple click)
2. Apply unorderedList / paragraph alignments

Expected behavior

Bullet point/ paragraph aligments to be applied to the current selected paragraph

Current behavior

Bullet point/paragraph alignments getting applied to the next paragragh as well
TripleClickUL-OL

Minimal example reproducing the issue

No response

Environment

  • Summernote version: 0.8.20
  • Browser (with version): Chrome 122
  • OS/Platform (with version):Windows 11 Enterprise laptop
@1der1
Copy link

1der1 commented Mar 11, 2024

The conversions even happen when a part of the line is selected.
Sometimes, a line node is selected but not the text contained in it.
Please end the selection with the last visible text character or earlier.

@GuruSireeshaP
Copy link
Author

Sorry, didnt get you , can you please elaborate a little on how this can be fixed

@1der1
Copy link

1der1 commented Mar 11, 2024

I'm sorry, I was only talking about changing the usage.

In our website builder, we branched from SN many years away.
We made the following change in the toggleList function:

We changed
var paras = rng.nodes(dom.isPara, { includeAncestor: true });

into

var paras = rng.nodes(dom.isPara, {  includeAncestor: false });
if(paras.length === 0) {
    paras = rng.nodes(dom.isPara, {  includeAncestor: true });
}

@DennisSuitters
Copy link
Member

DennisSuitters commented Mar 11, 2024

Strange, this happens with this main repo, but not with the Skunkworks version. When I get time, hopefully in the next couple of days, I'll compare the source and migrate the differences.

Edit: Hrm, I commented too soon, it does happen with the Skunkworks version, sigh

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

No branches or pull requests

3 participants