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
Ionic 3.7.1 and angular2-text-mask #13194
Comments
Here is the workaround where I have put on StackOverflow: https://goo.gl/D9GxUX |
@Sampath-Lokuge thanks for replying! but it doesnt work! the same error still occurs! I removed angular-text-mask from node_modules, npm installed as you said, changed the package.json and ran ionic serve here's my package.json the thing is.. this version of text-mask has these devDependencies: and my project is updated for the latest Ionic! |
It is sad :( I'm still using |
yup! if you update to the latest version you'll probably end up with the same issue! My other project with "ionic-angular": "3.5.3" and "@angular/core": "4.1.3", is perfect!! :( what can we expect from this? I found this: https://www.npmjs.com/package/ionic3-input-mask but it doesnt work either!! |
Did you |
you mean with the ionic3-..? |
See this: text-mask/text-mask#579 |
I did.. exactly like my previous project.. but in the text-mask docs they say they dont support the ion-input Ionic 2: Here https://github.com/text-mask/text-mask/tree/master/angular2#readme they say: Ionic 2 - Unfortunately, we are unable to support Ionic 2 ion-input at this point as it overrides the ControlValueAccessor that Text Mask requires to perform its job. |
But here it says something different no? text-mask/text-mask#246 |
something changed in these last updates on Ionic Input, dont know exactly what! |
Thats exactly what was happening before.. it seems like they fixed, but now we're back with the same issue!!!! |
Yes, You're right. Maybe Ionic team again uses |
hopefully someone like @jgw96 could give us a help!! |
Any good news about this? @tattivitorino |
@Sampath-Lokuge nothing yet!!!! :( |
Hmmm.... :( @tattivitorino |
I'm using |
@rfoel I think the problem is the latest version of Ionic.. my previous project with "ionic-angular": "3.5.3", and "angular2-text-mask": "^8.0.2", works perfectly |
I don't know about that. As long as I use the |
@rfoel, have you tried the Ionic 3.7.1 with the text mask? it doen't work! and if you check on the text mask issues it happened before, later the Ionic team fixed the problem but now it's back again |
@tattivitorino I did not try because the |
yes, @rfoel it seems like the 3.7.1 has lots of bugs to be fixed! :( maybe it is a case of downgrading ionic i think! is there a way to downgrade just ionic-angular? for instance: changing package.json entry to "ionic-angular": "3.6.xx", removing the dir from node_modules and running npm install again? |
@tattivitorino Yes, you can downgrade Ionic to |
Can I use Ionic Pro without any issue if I use |
@rfoel is there a way to specific target one version of ionic when running ionic start ... ? for instance: i'd like to use 3.6.1 as you sugested but ionic start will only give me 3.7.1 |
You can't. See : http://ionicframework.com/docs/cli/start/ |
@Sampath-Lokuge thats what i thought! :( |
@tattivitorino You can't. But once you downgrade a package version, NPM will display warns about other package versions. |
@Sampath-Lokuge I don't see a problem there. Ionic Pro is just a set of services. |
True. But it heavily depends on the |
I’ll attempt to address some of your issues later today. In the meantime some of this discussion should probably be moved to a more appropriate forum such as our slack channel. I can get you a link to that later as well. Not near my computer right now. |
tks a lot @kensodemann |
Thanks @kensodemann If you can give us a solution for this |
So there are serval issues that seem to be coming up here. Let me see if I can address them:
|
@kensodemann, tks so much for replying! |
@Sampath-Lokuge can you share here your package.json for the 3.6.1 app so i can check the right dependencies? |
This is the Package.json where I'm using and I don't have any issue with @tattivitorino Can you please provide the
|
@tattivitorino You don't need to create |
ok!!! no problem! i just want to test here the 3.6.0 (actually) version |
Any progress of |
@Sampath-Lokuge I dont want to get ahead of myself but after creating a new blank proj with the ionic 3.7.1 and the text-mask 8.0.2 the mask worked, but there's a new issue.. its not masking properly.. it is appending one character at the end after we blur the input!! and i've seen someone mentioning this behavior before... let me investigate a bit more.. let you know soon enough.. |
According to the Can you test the latest version of |
i never had any of these issues before.. but yes it could be a text-mask issue! i'll test with the latest! |
oh, could this have anything to do with lazy loading the page where i'm using the mask? because i'm importing the TextMaskModule (as before) in the app.component.ts |
No. You have done it on |
Exactly, @Sampath-Lokuge, i was importing into the root module, but thats the point! You need to import the TextMaskModule into the Page Module, not the APP Module as it was before!!! |
It can't be. Is that not working when you put that on |
trust me, it is! if you import the textmask module into the root module you wont be able to use it if your pages are lazy loaded.. with the page module!!! |
Oh.. Good to know about it. Is that working with latest |
i will test with the latest! but as i said you need to set maxlength on the input in order to get rid of the appending character on blur!!! it happens when you keep typing and blur the input.. |
Nice. Thanks 👍 @tattivitorino |
@Sampath-Lokuge the latest version doesn't work! it doesn't throw any errors but it doesn't mask the input content! so we need to stick with the 8.0.2 version! import it separately into the Pages Modules (which i think is not a good practice according to the angular's docs) and set the maxlength on the inputs! hard uh!!! but at least we found a workaround!!!! do you mind sharing this on their Git? Cheers |
Yes.Great. I have updated the StackOverflow post: https://stackoverflow.com/a/46435659/1077309 @tattivitorino Hope you can close this issue here now. |
ok @Sampath-Lokuge here's a good thing: shared.module.ts ` import {ConnFormatPipe} from './pipes/conn-format.pipe'; import {ImgPreloadDirective} from './directives/img-preload.directive'; import {TextMaskModule} from 'angular2-text-mask'; @NgModule({ your page's module import {SharedModule} from '../../shared/shared.module'; @NgModule({ cheers!! |
Since this appears to be resolved, but is kind of hard to follow, I am going to close this issue and lock the conversation. If either of you still have an issue related to this, please create a new issue with sample code in a GitHub repo for us to look at. |
Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x
[ ] 4.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
Please do not submit support requests or "How to" questions here. Instead, please use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
"Can't bind to 'textMask' since it isn't a known property of 'ion-input'."
Expected behavior:
ion-input accept text-mask as a property as it used to.
Steps to reproduce:
npm i angular2-text-mask --save
app.module.ts
import { TextMaskModule } from 'angular2-text-mask';
@NgModule({
imports: [
FormsModule,
TextMaskModule
],
declarations: []
})
in my component
login.ts
<input [textMask]="{mask: mask}" [(ngModel)]="myModel" type="text"/>
Other information:
Here https://github.com/text-mask/text-mask/tree/master/angular2#readme they say:
Ionic 2 - Unfortunately, we are unable to support Ionic 2 ion-input at this point as it overrides the ControlValueAccessor that Text Mask requires to perform its job.
is there a way to revert / fix this? As far as i know this is the only text-mask available, if not and somebody knows any other solution / plugin please let me know!
Any help will be very much appreciated!!
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: