RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.36k stars 2.18k forks source link

auto-separator and decimal optional place at the same time #2774

Closed amenekhalili closed 4 months ago

amenekhalili commented 4 months ago

there's no possible to have auto-separator and decimal optional place at the same time ! for example I want to have 23,444,444.55 but it won't be applied .

here's my config Custom Option(s) section to acheive auto-separator :

autoGroup : true ,
groupSize : 3 ,
groupSeparator: ","  

I also added this config for applying decimal optional place while typing but it didn't work and apply : radixPoint: "."

Techn1c4l commented 4 months ago

Are you setting the proper alias on your mask? Also remember to set substituteRadixPoint: false since you are using different decimal and group separators. The following option setup works fine for me:

{
  alias: 'decimal',
  autoGroup : true ,
  groupSize : 3 ,
  groupSeparator: ",",
  radixPoint: ".",
  substituteRadixPoint: false
}
amenekhalili commented 4 months ago

Thank you @Techn1c4l yes , I used
alias: 'decimal' . and I added substituteRadixPoint: false to my Code but it didn't work and apply !!! can you help me ?

Techn1c4l commented 4 months ago

Thank you @Techn1c4l yes , I used alias: 'decimal' . and I added substituteRadixPoint: false to my Code but it didn't work and apply !!! can you help me ?

Can you clarify what's exactly the issue? I've tried entering the number from your post and this is the result: image

Are you getting something different in your case?

amenekhalili commented 4 months ago

Thank you @Techn1c4l yes , I used alias: 'decimal' . and I added substituteRadixPoint: false to my Code but it didn't work and apply !!! can you help me ?

Can you clarify what's exactly the issue? I've tried entering the number from your post and this is the result: image

Are you getting something different in your case?

I'm using this plugin on APEX v23.1.0 when I hold "." button and insert decimal number , it works ! but without holding "." button , it doesn't apply ! Is that the way you insert decimal numbers like me?

Techn1c4l commented 4 months ago

Thank you @Techn1c4l yes , I used alias: 'decimal' . and I added substituteRadixPoint: false to my Code but it didn't work and apply !!! can you help me ?

Can you clarify what's exactly the issue? I've tried entering the number from your post and this is the result: image Are you getting something different in your case?

I'm using this plugin on APEX v23.1.0 when I hold "." button and insert decimal number , it works ! but without holding "." button , it doesn't apply ! Is that the way you insert decimal numbers like me?

Not sure I'm following you here. What do you mean by "inserting"? Pasting from the clipboard? Maybe you want it to always show the decimal part? Then use the digitsOptional: false setting.

amenekhalili commented 4 months ago

@Techn1c4l

inserting means typing decimal number with "." sign . No I didn't mean copy and pasting , as I said at the first I want to have both auto-separator and decimal optional place for decimal numbers while I'm typing the number !

about the showing the decimal part always , No I don't want it to be shown always , Just whenever the user needs to type decimal part.

right now by keep pressing "." button , I get what I want but I want to know would it be possible to do it without keep pressing on "." button ?

Techn1c4l commented 4 months ago

So you are saying that you can only start typing the decimal part if you hold down the "." key? Sounds weird to me. What happens if you you release it? Can you record the video with a smartphone for example to show me? Also, there are currently some issues with the group separator which lead to very harsh slowdown of the page. I suggest not to use the group separator at all.

amenekhalili commented 4 months ago

@Techn1c4l Yes,exactly right I must hold down "." key and typing the decimal part, I attach the video on my comment. I need to use group separator.

https://github.com/RobinHerbots/Inputmask/assets/59958687/45d3b22f-b7e8-4451-907b-530db053cd15

Techn1c4l commented 4 months ago

Well, this is really weird. I believe it has something to do with your digit symbols since they are not standard 0-9. It could be this library probably doesn't support digits you are using. Does it work if you don't use the group separator? Or it could be an issue with your spreadsheet library. Try creating a simple page using the same Inputmask options and see if you have this problem.

amenekhalili commented 4 months ago

Thank You @Techn1c4l My problem has been solved. one of my Dynamic Action in zero page of Application was causing that problem