Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-capitalization to custom list name input #6368

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import net.mullvad.mullvadvpn.compose.textfield.CustomTextField
import net.mullvad.mullvadvpn.lib.model.CustomListName
Expand Down Expand Up @@ -50,6 +51,7 @@ fun CustomListNameTextField(
)
}
},
capitalization = KeyboardCapitalization.Words,
modifier =
modifier.focusRequester(focusRequester).onFocusChanged { focusState ->
if (focusState.hasFocus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.VisualTransformation
Expand All @@ -43,12 +44,14 @@ fun CustomTextField(
visualTransformation: VisualTransformation = VisualTransformation.None,
supportingText: @Composable (() -> Unit)? = null,
colors: TextFieldColors = mullvadDarkTextFieldColors(),
capitalization: KeyboardCapitalization = KeyboardCapitalization.None,
keyboardOptions: KeyboardOptions =
KeyboardOptions(
keyboardType = keyboardType,
imeAction = ImeAction.Done,
autoCorrect = false,
)
capitalization = capitalization
),
) {

val scope = rememberCoroutineScope()
Expand Down
Loading