Questions tagged [react-imask]

7 questions
3
votes
0 answers

Phone mask (React IMask) does not work correctly with using React Hook Form

I am using IMask for phone input. And I also use react-hook-form. But the value does not update correctly. For example if I write 1234567 (with masked - 123-45-67) it returns wrong values. Firstly I think the reason is react-hook-form, but after I…
Rahil Əliyev
  • 247
  • 2
  • 8
3
votes
1 answer

Sharing refs between react-imask, react-bootstrap, and react-hook-form

I'm currently using react-bootstrap and react-imask together using their example with IMaskMixin: import { IMaskMixin } from 'react-imask'; import { FormControl } from 'react-bootstrap'; const MaskedFormControl = IMaskMixin(({inputRef, ...props})…
user210757
  • 6,996
  • 17
  • 66
  • 115
2
votes
0 answers

MUI TextField with Masked input and valid typescript

I'm trying to get rid of this typescript warning using IMask and MUI's Textfield with a phone number mask. I'm fairly new to typescript, an I think I'm missing something with the IMaskMixin generics or something. import { IMaskMixin } from…
CaptRespect
  • 1,985
  • 1
  • 16
  • 24
1
vote
1 answer

RegExp with react-imask not working - React, MUI, React-imask

I have an MUI TextField integrated with react-imask to mask as a GUID input. I entered a regex pattern in the mask prop but its not working. Please advice. import './style.css'; import React, { forwardRef, FunctionComponent } from 'react'; import…
arunmmanoharan
  • 2,535
  • 2
  • 29
  • 60
1
vote
0 answers

How to use IMask to create a mask with optional negative hours

I have a hour mask on my app, which I created using the IMask library (https://imask.js.org/guide.html), and it works very well on my input. This is my mask options: var maskOptions = { overwrite: true, autofix: true, mask: 'HH:MM', …
Guilherme do Valle
  • 401
  • 1
  • 4
  • 17
0
votes
0 answers

When pasting from the clipboard into a text field, the value doesn't pass validation through useIMask

When pasting a value from the clipboard, it should go through validation using the react-imask library, just like it does when I enter a value into the field using the keyboard. However, currently when I paste from the clipboard, once I remove focus…
-1
votes
1 answer

RegExp to match pattern with ranged mask till 596

I have got an input mask as an array = [/[0-5]/, /\d/, /\d/, ":", /[0-5]/, /\d/, ":", /[0-5]/, /\d/, ".", /\d/, /\d/, /\d/,] It corresponds formatting for example - 344:43:43.565 The maximum allowed number for first fracture (where 344 is now) - is…