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

Issue when using the enter key in a reply window #1296

Closed
mmallejac opened this issue Oct 30, 2023 · 11 comments
Closed

Issue when using the enter key in a reply window #1296

mmallejac opened this issue Oct 30, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@mmallejac
Copy link

Using the enter key in a reply window, to start a new line has a strange behavior: sometimes it works, sometimes it jumps one extra lines, sometimes 2, and sometimes even it puts the cursor somewhere inside the signature.
Is has been verified with Firefox and Brave, within 2 different Nextcloud instances.

We use Snappy 2.29.1 within Nextcloud 27.1.2

Thanks in advance for your help !

@mmallejac
Copy link
Author

See this little video that illustrates the bug, where the issue happens 2 times:

  • at "two": I press Enter, but the cursor comes back to previous line)
  • at "six": I press Enter once, but the cursor goes at the end of the message
snappyReplyBug.mp4

@andreasdirscherl
Copy link

+1
Exactly the same for me.

@the-djmaze
Copy link
Owner

Maybe related to #1339 where Squire added a <div><br></div> everywhere.
So check when v2.30 is released

@mmallejac
Copy link
Author

Hello ! Thanks for this.
I've upgraded to the latest version 2.30
Unfortunately still buggy

See the attached video : I've installed screenkey so that you can see what I am typing exactly.
Bugs at lines 1 and 4

Also attached a screenshot of the debugger tool :
F12

231204.Snappy.mp4

Another suggestion : maybe it could be nice / useful to have the About tab present not only within the Snappymail Config panel, but also while using it ? (in the Parameters section)
(as I wanted to be sure that I was using the latest version 2.30)

Hope this helps !
Cheers,

@the-djmaze the-djmaze added the bug Something isn't working label Dec 4, 2023
the-djmaze pushed a commit that referenced this issue Dec 4, 2023
@the-djmaze
Copy link
Owner

Please test my changes at https://snappymail.eu/demo/

@mmallejac
Copy link
Author

mmallejac commented Dec 4, 2023 via email

@andreasdirscherl
Copy link

andreasdirscherl commented Dec 4, 2023

I can confirm that the behavior persists in version 2.30.
Aldo did a test run on the demo account, and here all seems to work perfectly. Like Michel had already said. Fingers crossed!

Are we sure that is not something weird that Nextcloud introduces for snappymail? Similar to not being able to update snappymail through Nextcloud admin?
I'm on the latest Nextcloud version btw - Nextcloud Hub 6 (27.1.4)

At any rate, thanks @the-djmaze for all the hard work!

@the-djmaze
Copy link
Owner

the-djmaze commented Dec 4, 2023

It is Firefox.
Around Firefox 77 the cursor was gone and they fixed that.
But now Firefox has trouble when we set the Range and Selection in JavaScript.
Firefox reverts to the old Range selection.

It must be something in Squire and currently the demo skips the code that handles the Enter key.
Drawback is that <br> is not handled by Squire.

@andreasdirscherl
Copy link

OMG! You are a hero.
Just tried Chromium and yes, no cursor jumping around!
In a million years would I have thought of it being a browser issue. My beloved Firefox.
You would think that JavasScript should be handled correctly in all modern browsers... Alas...
Thanks for getting to the bottom of this!

@mmallejac
Copy link
Author

mmallejac commented Dec 5, 2023 via email

@the-djmaze
Copy link
Owner

Firefox bug:

if you set the Selection Range in the text node after the new line, it draws the cursor before the line break.

Squire:

Set the this._recordUndoState(range) which creates a hidden bookmark <input>
But this fails due to inUndoState == true

Workaround: force a _docWasChanged()

Real solution: TODO = find out why _docWasChanged() is not triggered at all

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