Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
* ui: add quiet zone as background to the exit code and adjust the brightness if it is shown
### Removed
### Fixed
* ui: Add missing focus to the product search field after opening the `ProductSearchView`

## [0.80.1]
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
Expand Down Expand Up @@ -80,14 +81,17 @@ open class ProductSearchView @JvmOverloads constructor(
var searchedCode by remember { mutableStateOf("") }

LaunchedEffect(Unit) {
focusRequester.requestFocus()
textFieldManager.showKeyboard()
}

Box(modifier = Modifier.padding(8.dp)) {
TextInput(
modifier = Modifier
.fillMaxWidth()
.focusRequester(focusRequester),
.focusRequester(focusRequester)
.onGloballyPositioned {
focusRequester.requestFocus()
},
value = searchedCode,
label = stringResource(id = R.string.Snabble_Scanner_enterBarcode),
keyboardOptions = KeyboardOptions(
Expand Down
Loading