mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	SearchToolbar: Check initial search query to open keyboard by default (#9297)
This commit is contained in:
		@@ -45,7 +45,6 @@ fun BrowseSourceToolbar(
 | 
			
		||||
    var selectingDisplayMode by remember { mutableStateOf(false) }
 | 
			
		||||
 | 
			
		||||
    SearchToolbar(
 | 
			
		||||
        initialShowKeyboard = searchQuery.isNullOrEmpty(),
 | 
			
		||||
        navigateUp = navigateUp,
 | 
			
		||||
        titleContent = { AppBarTitle(title) },
 | 
			
		||||
        searchQuery = searchQuery,
 | 
			
		||||
 
 | 
			
		||||
@@ -232,7 +232,6 @@ fun SearchToolbar(
 | 
			
		||||
    scrollBehavior: TopAppBarScrollBehavior? = null,
 | 
			
		||||
    visualTransformation: VisualTransformation = VisualTransformation.None,
 | 
			
		||||
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
 | 
			
		||||
    initialShowKeyboard: Boolean = true,
 | 
			
		||||
) {
 | 
			
		||||
    val focusRequester = remember { FocusRequester() }
 | 
			
		||||
 | 
			
		||||
@@ -257,7 +256,7 @@ fun SearchToolbar(
 | 
			
		||||
                    .fillMaxWidth()
 | 
			
		||||
                    .focusRequester(focusRequester)
 | 
			
		||||
                    .runOnEnterKeyPressed(action = searchAndClearFocus)
 | 
			
		||||
                    .showSoftKeyboard(initialShowKeyboard)
 | 
			
		||||
                    .showSoftKeyboard(remember { searchQuery.isEmpty() })
 | 
			
		||||
                    .clearFocusOnSoftKeyboardHide(),
 | 
			
		||||
                textStyle = MaterialTheme.typography.titleMedium.copy(
 | 
			
		||||
                    color = MaterialTheme.colorScheme.onBackground,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user