element-hq / element-hq/element-web

Pressing backspace in composer at beginning of second line deletes a character on the first line

Open
#22,177 0 comments 1 reaction 0 assignees View on GitHub
A-Composer O-Occasional S-Minor T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

1. In a room, with the composer focused
2. Type some text e.g. "word1 word2"
3. Go back to halfway through the text and insert a line break (I did this by pressing Return, but by default you need to press Shift+Return) so now the text is "word1 \nword2" and your cursor is immediately before the w of word2.
4. Press backspace

### Outcome

#### What did you expect?
The newline to be deleted

#### What happened instead?
The w of word1 on the first line was deleted!

![rec-2022-05-13_12 55 22](https://user-images.githubusercontent.com/76812/168278831-61010e42-53b6-4da1-87a7-a34d851c53ff.gif)

Note: I've noticed this a couple of times, for at least a week probably more, but thought I'd mis-typed.

### Operating system

Ubuntu 21.10

### Browser information

Firefox 99.0

### URL for webapp

https://develop.element.io

### Application version

Element version: 479d4bf64d97-react-fbbb9c27ba8f-js-4721aa1d241a Olm version: 3.2.8

### Homeserver

matrix.org

### Will you send logs?

No

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the web composer using the listed steps and inspect the composer’s backspace and line-break handling. Done means backspace at the beginning of the second line removes the newline rather than a character from the first line, with the behavior covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.