Status Update
Comments
si...@google.com <si...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 9ca11d4e49ede38c161349661b209ddf986b579e
Author: Qingqing Deng <qqd@google.com>
Date: Mon Aug 31 16:34:37 2020
[Text Selection] Remove SelectionContainer from the Top.
The SelectionContainer was moved to the top early this year. Before that, if the developer wants to enable the selection, a SelectionContainer needs to be use to wrap the content.
It's nice to enable selection without writing code to add a SelectionContainer since it's at the top. However, it introduces a lot of bugs. For example, the text in a button is automatically selected when the button is in the range of the seleted text. In addition, since LongPressAndDrag Gesture is in SelectionContainer which is at the top, it's hard for other components to detect long press and perform other actions.
After a few meetings, we decided to:
1. Remove SelectionContainer from the Top.
2. Move LongPressAndDrag into Text from SelectionContainer.
Bug: 158459594
Bug: 143413207
Bug: 161184848
Bug: 159743502
Test: Manually.
RelNote: Remove SelectionContainer from the Top to disable default selection and avoid unexpected behavior. One can specifically use a SelectionContainer to wrap the content that needs to be selectable instead.
Change-Id: I8dfe067d1a56ddb95c8fdd7fa2678e8ac43bba6b
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/Wrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/selection/SelectionContainer.kt
https://android-review.googlesource.com/1416219
Branch: androidx-master-dev
commit 9ca11d4e49ede38c161349661b209ddf986b579e
Author: Qingqing Deng <qqd@google.com>
Date: Mon Aug 31 16:34:37 2020
[Text Selection] Remove SelectionContainer from the Top.
The SelectionContainer was moved to the top early this year. Before that, if the developer wants to enable the selection, a SelectionContainer needs to be use to wrap the content.
It's nice to enable selection without writing code to add a SelectionContainer since it's at the top. However, it introduces a lot of bugs. For example, the text in a button is automatically selected when the button is in the range of the seleted text. In addition, since LongPressAndDrag Gesture is in SelectionContainer which is at the top, it's hard for other components to detect long press and perform other actions.
After a few meetings, we decided to:
1. Remove SelectionContainer from the Top.
2. Move LongPressAndDrag into Text from SelectionContainer.
Bug: 158459594
Bug: 143413207
Bug: 161184848
Bug: 159743502
Test: Manually.
RelNote: Remove SelectionContainer from the Top to disable default selection and avoid unexpected behavior. One can specifically use a SelectionContainer to wrap the content that needs to be selectable instead.
Change-Id: I8dfe067d1a56ddb95c8fdd7fa2678e8ac43bba6b
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/Wrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/selection/SelectionContainer.kt
Description
When you longpress a
TextButton
theText
inside it gets selected. I'd expect the selection to be off by default in this case.