Skip to content

Commit cca0697

Browse files
committed
Only show the keyboard when opening a tab for the first time
1 parent b152c98 commit cca0697

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ class BrowserTabViewModel @Inject constructor(
564564
@VisibleForTesting
565565
internal val autoCompleteStateFlow = MutableStateFlow("")
566566
private val fireproofWebsiteState: LiveData<List<FireproofWebsiteEntity>> = fireproofWebsiteRepository.getFireproofWebsites()
567+
private var alreadyShownKeyboard = false
567568

568569
@ExperimentalCoroutinesApi
569570
@FlowPreview
@@ -2970,7 +2971,12 @@ class BrowserTabViewModel @Inject constructor(
29702971
val shouldHideKeyboard =
29712972
cta is HomePanelCta || cta is DaxBubbleCta.DaxPrivacyProCta ||
29722973
duckAiFeatureState.showInputScreen.value || currentBrowserViewState().lastQueryOrigin == QueryOrigin.FromBookmark
2973-
command.value = if (shouldHideKeyboard) HideKeyboard else ShowKeyboard
2974+
command.value = if (shouldHideKeyboard || alreadyShownKeyboard) {
2975+
HideKeyboard
2976+
} else {
2977+
alreadyShownKeyboard = true
2978+
ShowKeyboard
2979+
}
29742980
}
29752981

29762982
fun onUserClickCtaOkButton(cta: Cta) {

0 commit comments

Comments
 (0)