Closed DanielMuller closed 5 years ago
Hey @DanielMuller, could you point me to the documentation related to using the input
attribute inside of an input element. I couldn't seem to find any information about it.
I was not able to reproduce this on iOS. I can try on an Android device.
Curious if this change would fix the problem you are experiencing: https://github.com/vuejs/vuejs.org/pull/1798
@jordanranz The PR you mention doesn't fix the issue, it just sets the documentation straight. From this comment on the VueJS repo, it seems to be failing with the default keyboard on Android only. iOS or other Android keyboards don't seem to be affected.
It looks like the issue is how this keybord triggers input changes on Android-MobileWeb.
In the amplify-vue component, they keyup
event seems to be fored before this.username
is updated. Which leads to en empty username sent to Cognito.
Sorry, I meant if we use v-bind
and v-on:input
instead of v-model
inside of the Amplify Vue component. This may fix your issue. I will try and reproduce this on a virtual device.
I was able to make it work by using v-model
and v-on:input
based on this comment.
Tested it on Chrome-Android, and Chrome Desktop. I will push a PR soon.
Awesome, will take a look now. Thanks for submitting a PR
Merged the fix. Please reopen a new issue if there are any related problems to this.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Describe the bug When trying to authenticate on Chrome Android using amplify-authenticator, the username isn't sent to Cognito, resulting in "Username cannot be empty" error. This happens when typing the username in the field, not when using autocomplete from saved logins. This doesn't happen on Desktop, only on mobile and only with certain keyboards.
This is related to vuejs/vue#8723
The problem is in https://github.com/aws-amplify/amplify-js/blob/6d34cbd865d813bb6b542bcd90d9ce05eaac40a0/packages/aws-amplify-vue/src/components/authenticator/UsernameField.vue#L92-94
this.username
is empty whenusernameChanged()
is called.To solve this, the input attribute needs to be added in input fields.
To Reproduce Steps to reproduce the behavior:
Expected behavior Typed username should be used.
Screenshots In this jsfiddle, typing anything in the fields should reproduce the content in the yellow box. First box is using only v-model, second box is using v-model and input
Desktop (please complete the following information): No issue no Desktop
Smartphone (please complete the following information):
Sample code https://jsfiddle.net/Lpwtfs4o/