Trying to implement adding an input mask via widget - strange behaviour
See original GitHub issueAre you requesting a feature, reporting a bug or ask a question?
Probably asking a question but could be a bug… Is this a bug or am I not implementing my input mask correctly using the widget? Trying to implement an input mask so date fields work better in non-HTML5 browsers.
What is the current behavior?
When I add an inputmask to a ‘text’ question via a widget the behaviour of other questions is affected but only if the other question’s visibility is switched on/off. Seems like the inputmask is being applied to other questions (including radio buttons).
What is the expected behavior?
The input mask should be applied to only the question I specify in the isFit of the widget.
How would you reproduce the current behavior (if this is a bug)?
See this Plunker demo http://plnkr.co/edit/vrdaruWul2Lpz0mUQm5q?p=preview
Steps to replicate the issue:
- Choose “Yes” for first question
- The second and third questions are then displayed. Second question shows correct input mask for date. Third question radio buttons can be selected.
- Then go back and choose “No” for the first question, then choose “Yes” for the first question again.
- The second and third questions are then displayed again. Second question shows correct input mask for date. But the third question radio buttons can’t be selected.
In my local implementation it throws the following error when I press the “Yes” option in question3:
Uncaught DOMException: Failed to set the 'selectionStart' property on 'HTMLInputElement': The input element's type ('radio') does not support selection.
at M (http://localhost:7304/Scripts/inputmask/dist/min/jquery.inputmask.bundle.min.js:9:21568)
at http://localhost:7304/Scripts/inputmask/dist/min/jquery.inputmask.bundle.min.js:10:2881
It’s strange because I’m not applying the inputmask to question3 at all…
Provide the test code and the tested page URL (if applicable)
http://plnkr.co/edit/vrdaruWul2Lpz0mUQm5q?p=preview
Specify your
- browser: Chrome
- browser version: 58.0.3029.110 (64-bit)
- surveyjs platform (angular or react or jquery or knockout or vue): jQuery
- surveyjs version: 0.12.17
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Hi @alekhraut I think you confused me with @dmitrykurmanov
@alekhraut, hello! I’ve created a small example with time inputmask: https://plnkr.co/edit/CbMV9qYPN579qg7Zlgbx?p=preview and it looks ok. I don’t have any experience in Ionic but in your sample I can’t find
surveyjs-widgets
string. Do you include widgets to the project? As I know Ionic works with Angular so you could check our Angular repo: https://github.com/surveyjs/surveyjs_angular_cli/blob/master/src/app/app.component.ts we have all widget examples there.