-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't validate Chips on mobile devices #5722
Comments
After some digging, it seems to occurs when chips are within the same FORM tag as others input fields. |
Hmm, after some testing it seems like a problem with Android's keyboard. When focused on an input within a Form the enter key is turned into a Tab key if there are following inputs. The weird part about this Tab is that it doesn't seem to fire any Keyboard events (keypress, keydown, keyup) so there is no way to handle it. A not so ideal solution is to add |
My solution until it's fixed correctly, if it can help someone.
|
I just created this quickly. Basically if user press spacebar, I trigger another keydown event which will be handled by chips input. You can also check for comma as a delimiter like
|
Tried this but it is showing
|
I'm just started building a site for a course project using materialize CSS and now I've just discovered this problem. Edit: In any case, Chips doesn't actually submit anything in forms directly, it stores everything in a data array... Not as documentation states though, each chip is stored in a separate dictionary within an array like: [{"tag": }]. So the trick? Place the Chip field outside the form. A submit button can be placed anywhere and just connected to the form with ID, so if you put it outside the form, before the submit button, it looks like it is still part of the form but android will default to hitting an enter key instead of tab, allowing entry of the chip data. Finally, Retrieve the tag data from the array , and append each tag in a hidden input field on form submit, and just format the data as you need around that. Really two years on and such a glaring issue hasn't been fixed. Sorry to say, I wIll not be using Materialize again... |
Yea don't use this framework. It is no longer maintained and really quite broken. |
I found a way when the spacebar is pressed. then it reads the input value of the chip alement and add it to the same chip with the addChip method |
Hello,
I can't seems to validate chips entries on mobile devices. At least on Android but maybe's the same on ios.
The problem occurs when there is another field following chips, so it's working fine on http://next.materializecss.com/.
Here is a codepen :
https://codepen.io/anon/pen/bLXpGJ
Just open it on Android Chrome and try to enter a chip, instead of an enter key there is a tab key on the keyboard so it jump to the next field instead of validating the chip.
There was no problem with 0.100.2
Tested on Nexus 5, Android 6, Chrome last version.
The text was updated successfully, but these errors were encountered: