Coder Social home page Coder Social logo

Comments (7)

tewedaj avatar tewedaj commented on July 4, 2024 5

TextEditingController controller = TextEditingController();
InternationalPhoneNumberInput( inputBorder: InputBorder.none, maxLength: Platform.isAndroid? 12 : 20, onInputChanged: (PhoneNumber number) { userDetail.phoneNumber = number.phoneNumber.toString(); controller.selection = TextSelection.collapsed(offset: controller.text.length); }, textFieldController: controller, formatInput: true, )

can you try doing something like this? i don't have IOS on me right now.. try it and let me know if it worked for you

from intl_phone_number_input.

mingzew avatar mingzew commented on July 4, 2024 3

Encountering the same issue, adding the below line helped me

InternationalPhoneNumberInput(
  ....
  onInputChanged: (PhoneNumber value) {
     _phoneNumberController.selection = TextSelection.collapsed(offset: _phoneNumberController.text.length);
  }
);

from intl_phone_number_input.

MahdiFakhrabadi avatar MahdiFakhrabadi commented on July 4, 2024 1

The issue is originating from utils/formatter/as_you_type_formatter.dart Line 86:
TextEditingValue( text: parsedText, selection: TextSelection.collapsed(offset: parsedText.length), )

It is possible to solve it by replacing selection to this:
selection: TextSelection.collapsed(offset: parsedText.length)

If this doesn't break somewhere else, please somebody commit this to codebase, thanks.

from intl_phone_number_input.

tewedaj avatar tewedaj commented on July 4, 2024

This just happened to our clients yesterday, can any one please address the issue

from intl_phone_number_input.

tewedaj avatar tewedaj commented on July 4, 2024

I was told the above code worked on iPhone 11 Pro max..

from intl_phone_number_input.

iabdousd avatar iabdousd commented on July 4, 2024

This is new on the new version, it's coming with the update to the PhoneNumberKit on iOS from libphonenumber-iOS

from intl_phone_number_input.

Shehzad1Dev avatar Shehzad1Dev commented on July 4, 2024

In onInputChanged method, add the following line

numCont.selection = TextSelection.collapsed(offset: numCont.text.length);

and numCont is your own TextEditingController.

Here is the full code:

onInputChanged: (PhoneNumber number) {
        numCont.selection = TextSelection.collapsed(offset: numCont.text.length);
        },

from intl_phone_number_input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.