Skip to content
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

TextField InputMask error #5685

Open
corgoss opened this issue Jul 10, 2024 · 5 comments
Open

TextField InputMask error #5685

corgoss opened this issue Jul 10, 2024 · 5 comments
Assignees

Comments

@corgoss
Copy link

corgoss commented Jul 10, 2024

Describe the bug
In old release in the textfield was field inputMask which has value null, but i upgrade the version to the latest and the value of the field changed to empty string. If i dont change from null to "" i got error : TypeError: Cannot read properties of null (reading 'length')
at Object.getInputMask
More in attachment.

Version/Branch
formiojs - 4.21.0
@formio/react - 5.3.0-rc.3

To Reproduce
Steps to reproduce the behavior:

  1. Create form
  2. Add component text field
  3. Edit in the component field "inputMask" to the null
  4. See error

Expected behavior
It can accept null and empty string

Screenshots
Screenshot 2024-07-10 at 08 56 12
Screenshot 2024-07-10 at 08 56 44

Additional context

@ZenMasterJacob20011
Copy link
Contributor

It looks like this was added in this commit 408229e#diff-d859ac9988451f6935f1f9d93f07a5c4330cccd7a2990b3f823375e1a851271c

We use the inputMask property to create input masks for the textfield component as per the InputMask documentation https://robinherbots.github.io/Inputmask/#/documentation

Is there any particular reason why the inputMask needs to accept null and an empty string?

@corgoss
Copy link
Author

corgoss commented Aug 9, 2024

In the old version of Formio, the inputMask was set to null, and we saved forms using this format. After upgrading Formio, we're now encountering errors on all these forms. We use version formiojs - 4.14.12

@ZenMasterJacob20011
Copy link
Contributor

What version of formio.js were you using that had inputMask set to null?

@corgoss
Copy link
Author

corgoss commented Nov 6, 2024

"@formio/react": "^5.2.4-rc.1"
"formiojs": "4.14.12",

@ZenMasterJacob20011
Copy link
Contributor

I checked out formiojs v4.14.12, created a textfield component, and viewed the components json but I still don't see the inputMask having a value set to null by default. Was version 4.14.12 the one were the input mask was set to null or was it a pervious version? If it was a previous version could you please provide the version were the input mask is set to null.
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants