question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to implement adding an input mask via widget - strange behaviour

See original GitHub issue

Are 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:

  1. Choose “Yes” for first question
  2. The second and third questions are then displayed. Second question shows correct input mask for date. Third question radio buttons can be selected.
  3. Then go back and choose “No” for the first question, then choose “Yes” for the first question again.
  4. 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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dmitrykobetscommented, Apr 17, 2018

Hi @alekhraut I think you confused me with @dmitrykurmanov

0reactions
dmitrykurmanovcommented, Apr 18, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Control data entry formats with input masks - Microsoft Support
Learn how to add input masks in Access to table fields, queries, and to form and report controls to help people entering data....
Read more >
2.2.1 p:caldendar and inputMask - they look strange
And I want to use "native" h:input, h:select... tags, but it's very hard to design "native" and PF's components (like p:calendar or p:spinner), ......
Read more >
PySide: reset cursor pos to 0 when clicking in QLineEdit in ...
I think the correct behaviour should be to always put the cursor at the beginning if the line-edit is empty.
Read more >
inputmaskcurrency - OutSystems
This behavior is not related to InputMask its related to OutSystems input widget (textbox) in case its type is number its not showing ......
Read more >
How do I fix strange cursor behavior in QLineEdit using ...
I noticed some strange behavior in QLineEdit after adding an inputMask. What I wanted was a binary display of a value, in groups...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found