-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: ion-input with type number throws error on value change #24753
Comments
@AlessandroFBK thanks for reporting this issue. This was caused in a recent change to fix another issue with Safari/iOS 15.3. I'll update that code to only reference the supported types and get a dev build available to test with. |
PR is open to address this issue. You can test/use the dev build in the interim:
Supports all Edit: This dev build was updated to the latest, based on this comment. |
I get a similar bug in Edit: Rolling back didn't work immediately (I suppose I have to delete the directory inside node_modules in this case) so I tried
|
@spicemix appreciate you testing and verifying. This bug making it into v6.0.7 was my fault. I wasn't aware that the I'll likely be introducing tests to validate that no console errors happen in our examples (currently researching the best mechanism to handle this well). Goof-ups are always an opportunity to strengthen the process to prevent future ones! |
@sean-perkins the patch doesn't seem to fix the bug on Chrome :(. But on Safari it's fixed. EDIT: At first I changed the version per hand in package.json, and then run yarn install, so I announced its not fixed :). But after explicitly running yarn add @ionic/[email protected] everything seems to work just fine. Hope I didn't get you guys confused. Cheers |
Hi, I have recently upgrade my Ionic 5 app to Ionic 6 and I'm facing the same issue. Hope there any new in order to fix it. Thanks! |
@Santisosa404 yarn add @ionic/[email protected] In case you have an ionic/angular app. I mean you can use this patch, until there is a stable release with the fix. |
this happens with input type email also. This happens only on Android and not on iOS. Updating to 6.0.8-dev.1644430127.1b9bb92 it did the trick. |
I had the same problem with field type email, using 6.0.2 and Angular 13.2.2. The 6.0.8-dev.1644430127.1b9bb92 branch fixed it for me. |
6.0.8-dev.1644430127.1b9bb92 fixed it for me as well, though I see other issue - on ion-input with type="number" pressing dot clears the input. Exactly same issue as here: #18864 |
The bug appeared since 6.0.2, I encountered it with the e-mail input. Due to another bug (memory leak in modals, #24460) I strongly discourage from downgrading to <6.0.3. I tried the dev build and it works for me. |
Same issue appears to be happening for |
FYI, version 6.1.0-dev.202112152233.e254a3a solves both issues for me |
This is not an issue on iOS 15 but the setSelectionRange does cause a side effect of setting the focus to the input box that the value changed even if it doesn't have focus. For example if you change dynamically the ngModel value of an input box that doesn't have focus it will automatically get focus. This was not an issue before. Can we make sure that the setSelectionRange is called only if the input has focus? |
Since I updated to 6.0.8-dev, the focus of input fields is messed up when I programmatically change its value. For example, if I add 2 chars to an input when the user starts typing, the cursor will not stay at the end of the value but instead stay before the two added values like this: Telephone: ________ User types a 0, I programmatically add +41 instead of the 0, the cursor | is like this now: Telephone: +|41_____ Expected: Telephone: +41|_____ |
Hello everyone, here's an updated dev build to verify with: You can install it for your respective I will update my original comment above, so that anyone coming across this issue does not install the outdated dev build. Thanks! |
I've got same error using ionic/vue on |
Dev build |
The PR to address this issue has been merged and will be available in 6.0.8 (tentative release date is Feb 16, this Wednesday). Thank you everyone for testing the dev builds and organizing the conversation in this thread! |
Thank you so muco for your commitment
Il Lun 14 Feb 2022, 20:35 Sean Perkins ***@***.***> ha
scritto:
… The PR to address this issue has been merged and will be available in
6.0.8 (tentative release date is Feb 16, this Wednesday).
Thank you everyone for testing the dev builds and organizing the
conversation in this thread!
—
Reply to this email directly, view it on GitHub
<#24753 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKFB5GVT3EY5XHPLLLFKORTU3FKOLANCNFSM5N55FHAA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
I noticed same thing with that IOS fix it seems to rely on selectionStart/End and any directive like a phone number field on top of an ion-input is now not working as cursor position gets messed up. (Seems to be broken since Ionic 6.02 and higher). |
Awesome Thanks works for me. Spent 3 hours retracing my changes thinking I created the error :( , but its fixed |
I thank everyone here. npm i @ionic/[email protected] |
Hi everyone, A fix for this issue has been released as part of Ionic 6.0.8. Please update your apps to receive this fix. Note: This issue only impacts Ionic 6. Ionic 4 and 5 apps are not impacted. Thank you for your patience as we worked to resolve this issue. |
Thank you @liamdebeasi, do you know if #24753 (comment) is also fixed? I think it is related to or even caused in the same way as this issue. |
Hello, I am seeing the same issue in 6.18.1. DOMException: An attempt was made to use an object that is not, or is no longer, usable Thank you. |
@etiennebon the latest production release of Ionic is Can you double check that you are on the latest version of Ionic dependencies? Please feel free to open a new issue if you are able to create a reproduction of the problem. Thanks! |
Hello Sean, Thank you. I just upgraded and now everything goes very well. Thank you very much for your quick response. Regards, |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behaviour
Given an
ion-input
with typenumber
the following error is thrown on each value change:
I notice that version 6.0.6 has recently changed the code that performs
setSelectionRange
on input element (link).The bug does not occur on previous version (6.0.5).
Expected Behavior
Typing in an
ion-input
with typenumber
should not result into an error.Steps to Reproduce
In an Angular application, add
Then type some value in the input element and check out the console log.
Code Reproduction URL
GitHub repository
Ionic Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: