question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BasicTextField doesn't render blank lines correctly

See original GitHub issue

If you create a multiline BasicTextField (singleLine = false), and enter a “blank line” (an empty line without any character, or a line with just whitespace), BasicTextField will nor render the text correctly.

For example, let’s take this text (you can put a space in the empty line if you want):

abcd

hijk

And compare it against this text:

abcd
x
hijk

First of all, you will see that the empty line will not have the same height as the others – it will be shorter. See example below.

See screenshot below. The pink border represents the BasicTextField.

BasicTextField bug

Second, in the scenario above, if you enter any number of white space (e.g. 3 spaces), when you move your cursor to the end of the next/previous line that is also longer (e.g. 6 characters), then using the keyboard you move the cursor up/down ONTO that line with the whitespaces, the cursor on the line with only whitespaces will not be shown correctly. The height will be wrong (I suspect because of the first issue above), but also the position is wrong as it always start at position 0, even though it has 3 characters. It should be placed at the end of the 3 whitespace, when moving from another line at a longer position, e.g. 6 chars.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
igordmncommented, Feb 4, 2022
0reactions
akurasovcommented, Feb 10, 2022

Fixed in 1.1.0-alpha04

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why BasicTextField (in compose) doesn't work well?
1 Answer 1 ... And can you please say why it's not working well with TextAlign.End ? ... @HamidSj add horizontalArrangement = Arrangement.End...
Read more >
TextField's cursor is small with empty value ... - Issue Tracker
StaticLayout does not call LineHeightSpan's for empty sstring (or the empty final line at the end of the string - a string that...
Read more >
How to Use Text Fields - Oracle Help Center
The text returned by this method does not include a newline character for the Enter key that fired the action event. You have...
Read more >
Advanced State and Side Effects in Jetpack Compose
... such as the drawer, or loading flight destinations doesn't work! ... screen to make sure that the MapView still renders properly.
Read more >
Image blocks - Squarespace Help Center
The image block won't display on your live site without an ... most common way to do this is with spacer blocks, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found