material-components/material-components-android-codelabs

setOnKeyListener not working on password edittext

hammamixgit opened this issue · 2 comments

hi ,
let's say that i wrote 7 letters in the password field , clicking on next will show me an error,
if i added any other chars the error doesn't disappear (setOnKeyListener seems to be triggered only when i delete one char from password)

I can't reproduce this behavior. Did you make any code changes? Maybe it's device specific?

setOnKeyListener() will only triggers on hardware button press only not on software click or on button press , change it with
'''
view.password_edit_text.addTextChangedListener(object : TextWatcher {

        override fun afterTextChanged(s: Editable) = Unit

        override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) = Unit

        override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
            if (isPasswordValid(password_edit_text.text!!)) {
                password_text_input.error = null
            }
        }
    })

'''