For mozilla-mobile#26736 - fix username validation error state (#28017)

fork
Rahul Sainani 2 years ago committed by GitHub
parent 68bcf7e872
commit efdb1172ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -195,8 +195,10 @@ class AddLoginFragment : Fragment(R.layout.fragment_add_login), MenuProvider {
binding.usernameText.addTextChangedListener( binding.usernameText.addTextChangedListener(
object : TextWatcher { object : TextWatcher {
override fun afterTextChanged(u: Editable?) { override fun afterTextChanged(editable: Editable?) {
usernameChanged = true // update usernameChanged to true when the text is not empty,
// otherwise it is not changed, as this screen starts with an empty username.
usernameChanged = editable.toString().isNotEmpty()
updateUsernameField() updateUsernameField()
setSaveButtonState() setSaveButtonState()
findDuplicate() findDuplicate()

Loading…
Cancel
Save