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

(Bug report) "Create and link new note" context menu moves the link to beginning of parent note #406

Open
diyoyo opened this issue Sep 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@diyoyo
Copy link
Member

diyoyo commented Sep 9, 2024

TriliumNext Version

0.90.4

What operating system are you using?

macOS

What is your setup?

Local + server sync

Operating System Version

macOS latest + server on Debian 12

Description

I had described this bug and gave up on it a long time ago in the original zadam github repo.
Just realized it still exists, so maybe it's time for a repost.

Basically, when using the @ followed by a new note, and then hitting Enter instead of using the mouse to click on the context menu button 'Create and link', then the link is moved to top of note.

Here are some screenshots of it.

Error logs

No response

@eliandoran
Copy link

Huh, that's crazy.

On my side the issue is only reproducible if I press enter to trigger the modal, but click on the new note type. Pressing enter to confirm the dialog does not cause the issue. I will look into it.

@eliandoran eliandoran added the bug Something isn't working label Sep 9, 2024
@JYC333
Copy link

JYC333 commented Sep 9, 2024

For me it happens when I create a new note with @ from template, also when using enter to select "Create and link". For a text note it won't jump to the beginning of the current note, and other default notes I didn't try.

@alexpietsch
Copy link
Member

I was debugging this for a few hours now, but couldn't find anything. It could be a bug with CKEditor, but I have no idea right now.

@eliandoran
Copy link

@alexpietsch , I looked a bit into the issue on my side and it's a really tough one.

The issue appears to be in the CKEditor indeed, but not in the upstream implementation but in our injection of the link. Here are my short notes on this subject:

Most likely culprit is that the range is lost in ckeditor plugin in packages\ckeditor5-build-balloon-block\src\mention_customization.js, where there is a dedicated check for the range:

const range = options.range || selection.getFirstRange();

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

No branches or pull requests

4 participants