-
Notifications
You must be signed in to change notification settings - Fork 455
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
fix(chat): preserve selection (caret) on new message input #14069
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not risky to browser differences / client
From my past memory (at phpBB with BBCodes, as well as Nextcloud with the mentions bubbles) this is giving me nightmares. This needs proper testing on each supported browser / platform combination before merging:
- Desktop Client
- Windows / Firefox
- Windows / Chromium
- Linux / Firefox
- Linux / Chromium
- Mac OS / Firefox
- Mac OS / Chromium
- Mac OS / Safari
- iPhone/iPad / Safari Mobile
- Android / Firefox
- Android / Chrome
Testcases:
- In the end
- In the middle
- With replace
- Having new lines and mentions (without adding
<br>
) - With replacing new lines and mentions
- Opening the picker by mouse, by SHIFT+Tab + Enter
- Closing the picker by ESC, by click outside, by click on the trigger
Not sure which browser/OS it was, but I remember multiple selections being a thing? If that is correct we also need to test this 🙈
All mentioned testcases are cross-platform. Problematic testcases:
|
Windows-desktop.mp4
windows-firefox.mp4
windows-chrome.mp4
linux-firefox.mp4
linux-chromium.mp4
macos-firefox.mp4
macos-chrome.mp4
macos-safari.mp4
ios-safari.mp4
android-firefox.mp4
android-chromium.mp4 |
cdd09c4
to
d26fc4b
Compare
d26fc4b
to
4b904f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, left a couple of comments
Signed-off-by: Grigorii K. Shartsev <[email protected]>
02ce957
to
aab0db9
Compare
/backport to stable31 |
☑️ Resolves
Preserve new message input's selection (caret position) on blur and restore on focus.
Currently only useful for emoji picker, but can be useful in other inserts.
Using preserved selection, emoji picker inserts the selected emoji in the correct position.
Additional change: after the emoji picker close, the focus returns to the field.
🖌️ UI Checklist
🖼️ Screenshots / Screencasts
Works:
<br>
)🏁 Checklist