mirror of
https://github.com/bitwarden/android.git
synced 2026-03-21 22:00:42 -05:00
PM-16474 Adding custom field issues when another text field holds focus (#4511)
This commit is contained in:
@@ -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
|
||||
@@ -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"),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user