Giter Site home page Giter Site logo

Comments (5)

jackocnr avatar jackocnr commented on June 14, 2024 2

Thanks for reporting. Fix released in v19.2.7.

from intl-tel-input.

Nedimko123 avatar Nedimko123 commented on June 14, 2024 1

@jackocnr Alright, what the hell, that fix was so fast, thanks

from intl-tel-input.

Nedimko123 avatar Nedimko123 commented on June 14, 2024

For example the version:

import { component$, useSignal, useStore, useStyles$, useVisibleTask$ } from '@builder.io/qwik'

export default component$(() => {
    useVisibleTask$(() => {
        var input = document.querySelector('#phone')
        window.intlTelInput(input, {
            utilsScript: 'https://cdn.jsdelivr.net/npm/[email protected]/build/js/utils.js',
            formatOnDisplay: true,
            countrySearch: false,
        })
    })
    return (
        <>
            <input type="text" id="phone" class="bg-gray-700 text-white" />

            <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/build/css/intlTelInput.css" />
            <script src="https://cdn.jsdelivr.net/npm/[email protected]/build/js/intlTelInput.min.js"></script>
        </>
    )
})

Has the working search but It does not format the numbers, so what can I do?

from intl-tel-input.

Nedimko123 avatar Nedimko123 commented on June 14, 2024

Version 19.1.0 is when I notice that it does format the number on input

from intl-tel-input.

Nedimko123 avatar Nedimko123 commented on June 14, 2024

Since we decided to use the older version, it looked prettier but it didn't support autoFormatting we did the formatting oninput:


   onInput$={async (_, inputField) => {
                        const number = iti.value?.getNumber() as string
                        if (isFullString(number) && number.length > 1) {
                            const currentFormat =
                                number[0] === '+' ? intlTelInputUtils.numberFormat.INTERNATIONAL : intlTelInputUtils.numberFormat.NATIONAL
                            const formattedNumber = intlTelInputUtils.formatNumber(number, '', currentFormat)
                            iti.value?.setNumber(formattedNumber)
                            props.state[props.id] = formattedNumber
                        }

                        await validateInputField(inputField)
                    }}

from intl-tel-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.