Skip to content

Commit

Permalink
PM-16474 Adding custom field issues when another text field holds foc…
Browse files Browse the repository at this point in the history
…us (#4511)
  • Loading branch information
dseverns-livefront authored Jan 7, 2025
1 parent b0e9703 commit 80f31cd
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import com.x8bit.bitwarden.R
Expand Down Expand Up @@ -71,10 +72,14 @@ fun VaultAddEditCustomFieldsButton(
},
)
}

val focusManager = LocalFocusManager.current
BitwardenOutlinedButton(
label = stringResource(id = R.string.new_custom_field),
onClick = { shouldShowChooserDialog = true },
onClick = {
// Clear any current focused item such as an unrelated text field.
focusManager.clearFocus()
shouldShowChooserDialog = true
},
modifier = modifier.testTag("NewCustomFieldButton"),
)
}

0 comments on commit 80f31cd

Please sign in to comment.