JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.9k stars 1.16k forks source link

TextField crashing on kotlin compose desktop #2891

Open marcelo-juncken opened 1 year ago

marcelo-juncken commented 1 year ago

Describe the bug app is crashing with a simple textfield in an empty composable app when selecting text, typing again and dragging

Affected platforms Desktop

Versions 1.8.0- Kotlin version: 1.3.0- Compose Multiplatform version: windows 10 home - OS version(s): x64- OS architecture : 18.0.2.1 - JDK:

To Reproduce

  1. Create a simple TextField
  2. run the app
  3. type anything that has more than 2 letters (I couldnt replicate with one letter, but I did with two).
  4. select some part of the text (You have to select 2 or more letters, and prefer select going from the end to the left, otherwise its harder to replicate) without releasing the mouse button
  5. type anything
  6. move mouse button to anywhere
  7. release mouse button error

Expected behavior Nothing

Additional Information Bug doesn't happen on versions: kotlin.version=1.6.10 compose.version=1.1.1

eymar commented 1 year ago

Reproduced on MacOs too: https://github.com/eymar/repr_compose_2891

Compose: 1.3.1 Kotlin: 1.8.10

I confirm that it works in compose 1.1.1

eymar commented 1 year ago

@starglad Thanks! The issue is clear and reproducible.

What behaviour did you want to achieve my typing while keeping the mouse button pressed after selection + moving the mouse afterwards?

Did you expected anything useful from that sequence of actions? I'm trying to understand if there is some sort of UX pattern (common action) implemented with the steps you described.

marcelo-juncken commented 1 year ago

I didnt expect anything at all actually..I did this by accident when trying to test masks on textfield. First I thought it was an issue with my mask, but then I saw it happened in a clean project.

marcelo-juncken commented 1 year ago

@starglad Thanks! The issue is clear and reproducible.

What behaviour did you want to achieve my typing while keeping the mouse button pressed after selection + moving the mouse afterwards?

Did you expected anything useful from that sequence of actions? I'm trying to understand if there is some sort of UX pattern (common action) implemented with the steps you described.

I forgot to mention, but for some reason(may be related to the same issue) when typing fast, sometimes the last letters mixes up. Like if I type "asdf" it comes "adsf". It happens on the same version as the issue above (1.8.0 kotlin and 1.3.0 compose). Additionally it also DOESN'T happen at kotlin 1.6.10 and compose 1.1.1

okushnikov commented 2 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.