When we submit a form where their fields are filled with a state through amp-bind, mask fields stop working.
1- Create a form with fields that use masks and their values are saved in a state.
2- Create an event in the submit-success of the form to clear these states.
`
class='units-form container' <input type="email" on='input-debounced:AMP.setState({inputs:{mail : event.value}})' [value]="inputs.mail" name="email" id="email" placeholder="E-mail" required>
<input on='input-debounced:AMP.setState({inputs:{cel : event.value}})' placeholder="Celular" [value]="inputs.cel" mask="(00)0000-00000" type="tel" name="cel" pattern="(^(\()?[0-9]{2}(\))?-?(\s)?([0-9]{8}|[0-9]{9}))|(^([0-9]{8}|[0-9]{9}))|(^(\()?[0-9]{2}(\))?-?(\s)?([0-9]{4}|[0-9]{5}|[0-9]{9})-?([0-9]{4}|[0-9]{5}))" required>
<input type="submit" class="form-submit" value="Agendar">
`
3- Create a backend to successfully return form submission.
4- Fill in the form and submit.
5- Try to fill the field that has the mask. You will not be able to type in it.
All
All
Hi, thank you for filing this bug! Quick update: I was able to reproduce the problem and am looking into what is causing this.
I am facing the same issue... so, adding to @crisfran01 comments, I noticed 2 weird behaviors:
I created this gist to help reproduce the bug:
https://gist.github.com/azinod/9b601b44964c42cf5a9cf89fed3610a8.
You can copy + paste it to AMP Playground for a quick test.
Thanks for the helpful markup, and for your patience here while we resolve this. :)
Most helpful comment
I am facing the same issue... so, adding to @crisfran01 comments, I noticed 2 weird behaviors:
I created this gist to help reproduce the bug:
https://gist.github.com/azinod/9b601b44964c42cf5a9cf89fed3610a8.
You can copy + paste it to AMP Playground for a quick test.