Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5619bfa0 authored by Josh's avatar Josh
Browse files

add shortcut dialog should receive default focus in touch mode

Previously the add shortcut dialog edit key component wasn't receiving
default focus when the dialog was triggered using touch(clicking on the
+ button on the right side of shortcut)

This has now been fixed by explicitly indicating that the component
canFocus = true rather than allow this be defined for us by the system.

Test: Manual - open  shortcut helper, enter customize mode, press the
plus button on the right side of shortcut  to open customization dialog.
Ensure the text box with "press key" prompt is focused by default.
Flag: com.android.systemui.keyboard_shortcut_helper_shortcut_customizer
Fix: 380439658

Change-Id: Ib51cb61b2b94c73b367e52074d9175319dab7f99
parent bb45bda7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusProperties
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.key.KeyEvent
@@ -269,6 +270,7 @@ private fun SelectedKeyCombinationContainer(
                .sizeIn(minWidth = 332.dp, minHeight = 56.dp)
                .border(width = 2.dp, color = outlineColor, shape = RoundedCornerShape(50.dp))
                .onKeyEvent { onKeyPress(it) }
                .focusProperties { canFocus = true } // enables keyboard focus when in touch mode
                .focusRequester(focusRequester),
        interactionSource = interactionSource,
    ) {