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

TypeError: this.mask.split is not a function #8

Open
romulowspp opened this issue Jun 19, 2017 · 3 comments
Open

TypeError: this.mask.split is not a function #8

romulowspp opened this issue Jun 19, 2017 · 3 comments

Comments

@romulowspp
Copy link

I'm using the version for the angular. I followed all the steps that have been described here.

But when my page loads I get the following error:

JS: TypeError: this.mask.split is not a function
JS:     at MaskedTextFieldBase._generateMaskTokens (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/nativescript-masked-text-field/masked-text-field-common.js:48:35)
JS:     at valueChanged (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/nativescript-masked-text-field/masked-text-field-common.js:131:16)
JS:     at MaskedTextField.Property.set [as mask] (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/tns-core-modules/ui/core/properties/properties.js:82:25)
JS:     at ViewUtil.setPropertyInternal (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/nativescript-angular/view-util.js:192:32)
JS:     at ViewUtil.setProperty (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/nativescript-angular/view-util.js:155:18)
JS:     at EmulatedRenderer.NativeScriptRenderer.setAttribute (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/nativescript-angular/renderer.js:126:30)
JS:     at DebugRenderer2.setAttribute (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:13383:23)
JS:     at createElement (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:9378:22)
JS:     at createViewNodes (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:12051:44)
JS:     at callViewAction (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:12537:13)
JS:     at execComponentViewsAction (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:12446:13)
JS:     at createViewNodes (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:12120:5)
JS:     at createRootView (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:11998:5)
JS:     at callWithDebugContext (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:13213:42)
JS:     at Object.debugCreateRootView [as createRootView] (file:///data/data/org.nativescript.meupatrocinio/files/app/tns_modules/@angular/core/bundles/core.umd.js:12673:12)

The html: <MaskedTextField col="2" class="text-field text-field-bordered" mask="000" keyboardType="number"></MaskedTextField>

Thanks.

@PeterStaev
Copy link
Owner

Hey @Ablankzin , this seems to be an issue with the NS Angular implementation specific to the format of the mast and that it is automatically converted by the runtime to a number. So in the plugin I receive the value as the number 0 and not as the string 000.
I've logged an issue: NativeScript/nativescript-angular#854 so we will see what will happen.

Sadly currently I do not have a workaround for this, except to change your mask to have at least one non-digit character, so that it does not get converted by the runtime...

@romulowspp
Copy link
Author

romulowspp commented Jun 19, 2017

I made a little change to temporarily support mask 9.

#9

@vcooley
Copy link

vcooley commented Jun 25, 2017

I've run into this before and temporarily solved this issue by inserting a zero-width space between two of the zeros.

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

No branches or pull requests

3 participants