material-components / material-components/material-components-android
[BotttomSheetDialog] Text Selection Thumbs offset when placed inside of BottomSheetDialogFragment
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:** When selecting text inside of a `BottomSheetDialogFragment` the thumbs are not attached to the actual selection and jump to the top of the screen and are displayed outside of the actual bottom sheet.
https://github.com/user-attachments/assets/3906e7ce-61d9-47e0-aa46-684e3b9a1dbe
**Expected behavior:** The thumbs should be attached to the text selection and not float at the top of the screen.
**Source code:**
```kotlin
class BottomSheetFragment() : BottomSheetDialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
return ComposeView(requireContext()).apply {
setContent {
Scaffold(
topBar = {
Text("Bottom Sheet")
}
) { padding ->
Column(Modifier.padding(padding).padding(16.dp)) {
TextField(
"Test",
onValueChange = { },
label = { Text("Label") }
)
}
}
}
}
}
}
```
**Minimal sample app repro:** [BottomSheetSelectionRepro.zip](https://github.com/user-attachments/files/21735747/BottomSheetSelectionRepro.zip)
**Android API version:** 36
**Material Library version:** 1.13.0-rc01
**Device:** Google Pixel 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked BottomSheetSelectionRepro.zip and the BottomSheetFragment source shown in the issue. Run the sample on the stated Pixel 7/API 36 setup with Material Library 1.13.0-rc01, then inspect the BottomSheetDialogFragment and ComposeView integration while reproducing text selection. Done means the selection thumbs remain attached to the selected text inside the bottom sheet.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100