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: @textcomplete dropdown mentions and emojis not working on mouse click #341

Open
cisnerosebastian opened this issue Dec 20, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@cisnerosebastian
Copy link

cisnerosebastian commented Dec 20, 2022

Since nodebb update 2.6.1 (it has updates on composer default and new @textcomplete plugin) mentions and emjis dropdown item on click not working. Its working just fine if selected with keyboard and "enter" key. Its working perfect on composer default, but not on quill composer. When you click with mouse button, the composer content area scrolls up, and no autofill is done.

image

I've installed a clean new nodebb 2.6.1 , quill 3.0.2 and its not working
also updated nodebb to 2.7.0 and still not working
then unistalled quill, and used composer default, and its working just fine

I'm not 100% sure where to report this bug, as it can be on nodebb update, or composer-quill, or composerdefault, or maybe in the @textcomplete plugin. Let me know if I have to report this in another repo.

Thanks.

@barisusakli
Copy link
Member

Looks bugged, I also get this error in the browser console sometimes

Uncaught Error: Unexpected
    at ContenteditableEditor.getRange (ContenteditableEditor.js:113:19)
    at ContenteditableEditor.getRange (ContenteditableEditor.js:117:28)
    at ContenteditableEditor.getBeforeCursor (ContenteditableEditor.js:86:28)
    at ContenteditableEditor.emitChangeEvent (Editor.js:71:36)
    at ContenteditableEditor.onInput (ContenteditableEditor.js:11:18)

@Incryve
Copy link

Incryve commented Feb 22, 2023

Hi there @barisusakli ! I was wondering if there has been a fix to this issue yet. My users keep drawing my attention to it and I'm hoping to address the problem asap. Thank you very much!

@barisusakli
Copy link
Member

@Incryve nope, I tried to fix this but couldn't figure out the issue. Seems like textcomplete and quill don't play nice together. Selecting a option from the dropdown in textcomplete doesn't add the selected text into the quill composer.

@cisnerosebastian
Copy link
Author

@barisusakli I may have some time to check on this issue. If you have any idea where the problem may be let me know.

@barisusakli
Copy link
Member

Some of the related code is here https://github.com/NodeBB/nodebb-plugin-composer-quill/blob/master/static/lib/quill-nbb.js#L338-L367, it works when you press enter but mouse clicks on the dropdown doesn't work. The autocomplete module is actually in composer-default here https://github.com/NodeBB/nodebb-plugin-composer-default/blob/master/static/lib/composer/autocomplete.js#L17-L65

@cisnerosebastian
Copy link
Author

@barisusakli I've been trying to understand how this works. Its like quill is intercepting keyboard and mouse events to update the quill contents and cursor. So, in this code

https://github.com/NodeBB/nodebb-plugin-composer-quill/blob/master/static/lib/quill-nbb.js#L362-L367

what is doing is like adding the tab and enter key events on the top of the list of quill events

maybe something similar is what we have to achieve with the mouse events?

On another hand, I can see that the textcomplete is actually getting the click event , and returning the right value, but that content is not been added on the quill contents.

Anyway, I will try to spend more time on this next week.

@barisusakli
Copy link
Member

Yeah that's what I found out too, when you click something in the dropdown that text doesn't get inserted into the quill editor.

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

3 participants