-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Pill mentions can break when editing trailing colon #4864
Comments
On my machine: On Chrome 60.0.3112.78 on Ubuntu:
On FF Nightly on Ubuntu:
|
Thanks for testing, I'll have to recheck on Nightly - I wrote these steps to reproduce based on Chrome behaviour, and I remember having similar pill issues on Nightly, but maybe the exact behaviour differs. |
This is probably because there's an "R" for the avatar of this person. Draft-js has a bug where it expects the text inside the pill to be exactly the text it decorates - #4772. This leads to all sorts of exciting misbehaviour. |
A workaround for this could be to not have any text in the member avatar in pills. I'm not sure what we'd put there instead. Maybe no avatar? Maybe a placeholder image? |
Could the issue be sidestepped by using an SVG "image" containing the text? |
This bug is super-annoying (as per #5002 - @turt2live thanks for spotting the dup :) |
@ara4n: Even if it does, there's always |
Breakage with different symptoms:
|
SGTM |
OK so it turns out that the SVG |
@lukebarnard1: What about an |
@eternaleye this would strictly be an option. But we do lose the CSS, which means themeing won't work. |
@lukebarnard1: I thought the SVG was just for the letter itself, though, not even the background? At that point, we don't "lose the CSS" any more than we do when a user has an avatar set... |
By CSS I meant we lose the ability to apply a different colour to the initial through the existing theme mechanism. |
¡Hola @ara4n! This just bite me yet again on https://riot.im/develop/ and annoyed me enough to comment. Any hopes for a fix or workaround to this bugger? ¡Gracias! |
This bit me just now on Firefox 57.0 (Quantum) as well. So just a +1. |
+1 too |
fixed in matrix-org/matrix-react-sdk#1890 |
Description
After inputting a pill mention (start typing user name and tab-complete it), resulting in e.g.


if you attempt to edit the trailing colon to change it e.g. in a comma using backspace, you may end up breaking the pill and have instead:
I'll describe the exact steps to reproduce below. Note that it's only one breaking case, I've experienced similar (and more blocking, needing a refresh of Riot) issues in slightly different scenarios for which I haven't debugged the exact steps to reproduce yet. I may describe them later on here or in a new issue when I come to that.
Steps to reproduce
red<TAB>
and get it completed as:Note that the cursor is two columns after the pill, preceded by a colon and a space.
Note that the cursor is not next to the pill as expected, but inside it. (*)
Note that the comma is placed after the cursor and the pill, and the cursor stays inside the pill as if expecting the user to append to the username.
(*) One could expect that the cursor is inside the pill to allow appending to the username (e.g. to mention


@reduzio
instead of@reduz
, but in all evidence it does not work, as the first added character is inputted after the pill without moving the cursor, and the second one breaks the pill:2. (a). Input
i
:2. (b). Input
o
:Also worth mentioning, waiting long enough (5 s) between keystrokes allows to continue inputting stuff according to the 2. (a) logic.
Version information
For the web app:
The text was updated successfully, but these errors were encountered: