Questions tagged [imaskjs]

27 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
3
votes
3 answers

React - Material UI - TextField controlled input with custom input component with custom props

How can I pass custom props to the inputComponent? For example, I have a MuiTextField component: const CustomerSocialMask = React.forwardRef( function CustomerSocialMask(props, ref: any) { // deploy test const {…
Ericson Willians
  • 7,606
  • 11
  • 63
  • 114
3
votes
2 answers

In angular-imask how do I get the IMask class?

Using Angular-IMask, I'm programatically updating the field that has IMask. So I'm getting the error: "Element value was changed outside of mask. Syncronize mask using mask.updateValue() to work properly." I programatically change the input because…
Nelson Teixeira
  • 6,297
  • 5
  • 36
  • 73
2
votes
1 answer

In angular-imask how do I use imaskElement attribute?

I'm trying to find a way to access the imask object in Angular. I saw this attribute [imaskElement]="(elementRef, directiveRef) => maskElement" but when I try to connect it to a property in my component…
Nelson Teixeira
  • 6,297
  • 5
  • 36
  • 73
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
1
vote
2 answers

Add imaskjs with rails and hotwire stimulus but it doesn't work

I'm trying to make stimulus controller to mask 2 input field, "gross revenue" and "operating cost" to display thousand separator on both fields. I've tried imaskjs with stimulusjs, but I don't know why it doesn't werk at all.
1
vote
0 answers

Conditional Phone masking Imask.js

I have below code : var items = document.getElementsByClassName('phone-mask'); Array.prototype.forEach.call(items, function(element) { var phoneMask = new IMask(element, { mask: '000-0000-000', placeholder: { show: 'always' …
1
vote
0 answers

How can I add a fixed string to an imask field?

In the documentation we have the following example: var phoneMask = IMask( document.getElementById('phone-mask'), { mask: '+{7}(000)000-00-00' }); I know I can fix characters using {}, but I'm struggling to do…
Ericson Willians
  • 7,606
  • 11
  • 63
  • 114
1
vote
1 answer

Issue with imaskJS data formatting forward slashes

I've tested this on the frontend of the imask (https://imask.js.org/) website, and can confirm that when you use a forward slash for the date formatting it refuses to allow the final digit of the date. I have tried using: IMask( field, …
1
vote
0 answers

Apply IMask to created element

I want to be able to press a button and create two new inputs below the button, the first input needs to be formatted by imask as follows: 00:00:00 Currently I can only do that to the inputs I create manually. How can I add IMask configs to every…
Sam Kultz
  • 11
  • 2
1
vote
1 answer

How to use input mask in Javascript for Mac ID & Phone Number

I want to filter Phone numbers & Mac id from one input field... if the string starts with '00' then put a colon after every two integers with characters & if it starts with any other number did not put a colon after two numbers... var dynamicMask =…
0
votes
1 answer

iMask plugin for Angular: the unmask property doesn't allow typed

I'm using the iMask plugin for Angular, and when I set the value of the unmask attribute to 'typed', I'm encountering an error that doesn't occur when I use 'true' or 'false' as the value. This is the input:
0
votes
0 answers

iMask Vue.js 2 returning value error: value should be string"

I'm using the pattern mask, I have iMask imported. Here's a snippet. Vue 2. iMask v 6.6.1
Claude M
  • 23
  • 6
0
votes
3 answers

Remove "0" at the begininning of phone number with imask.js

I'm trying to use imask.js for phone validating on subscribe form. I currently have this simple code : var phoneMask = IMask( document.getElementById('number_phone'), { mask: '+{33}000000000' }); I want to disable the capacity of put a 0 just…
romdev
  • 13
  • 4
1
2