azerion / phaser-input

Adds input boxes to Phaser like CanvasInput, but also works for WebGL and Mobile, made for Phaser only.
MIT License
201 stars 64 forks source link

'0' has no input count limit if using InputType.number #75

Open Cerlancism opened 5 years ago

Cerlancism commented 5 years ago

I need an input validation for numbers only from 0 to 10

const field = this.add.inputField(0, 0, {
            type: PhaserInput.InputType.number,
            max: "10",
            min: "0",
        })

I observed that 0 can be repeated on the field. Is it possible to restrict to a single '0'? Or are there any on input event and is focused boolean so I can custom validate on the fly as walkaround by using directly from phaser input events?