beholdr / maska

Simple zero-dependency input mask for Vue, Svelte, Alpine.js and vanilla JS.
https://beholdr.github.io/maska/
MIT License
1.79k stars 71 forks source link

Cursor location doesn't move correctly with "number" type input with "." mask #179

Closed cyuz closed 11 months ago

cyuz commented 1 year ago

Describe the bug

Cursor location doesn't move correctly with "number" type input with "." mask When I type the ".", cursor will move to the start

If I use an input with type="text", it works smoothly. Maybe this should be documented.

Steps to reproduce

    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/maska@2/dist/maska.umd.js"></script>

    <div id="app">
        <input type="number" v-model="message" v-maska data-maska="###.##" />
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                message: ''
            },
            directives: { maska: Maska.vMaska }
        })
    </script>

Reproduction link

https://vue-maska-urdctr.stackblitz.io

beholdr commented 11 months ago

Yes, it was documented for version 1.x. In current docs now too. Thank you.