Comments (8)
Hello @margulan97!
Thanks for your report.
That's an expected behaviour. Acts the same as if you paste text into the empty field.
from input-mask-ios.
but for example: if primaryMask "6 [999]", put("699", textfield) output = "6 99",
but if first char is not 6 put("999", textfield) output = "6 999", this bug appears only when the first digit in the mask is the same as first digit in put. is that correct behavior?
from input-mask-ios.
you don't know which part of the code I need to look at to fix the bug?when I debug In apply func in the Mask class and character is not inserted to modified string. a try to check valueState override func accept(character char: Character) -> Next?. but there is no logic that will cause it. if it's not difficult for you to point out which part of the code I should look at to find a solution. thank for reply
from input-mask-ios.
put("999", textfield) output = "6 999"
Yep, this is also a correct behaviour. When you paste 999
from clipboard, you'd expect all of your digits to be utilised, so the library doesn't cut anything but puts a prefix before the string.
you don't know which part of the code I need to look at to fix the bug?
Could you please elaborate a little bit more on where the 699
value comes from? The solution would rather depend on it.
For instance, if 699
is a documented value which comes from your backend APIs, and if you know it's always three digits, then the problem is obviously a "frontend rendering" issue; the value will always lack the necessary 6
prefix, thus it's okay to insert it everywhere like you did.
If 699
is stored mobile-wise, I'd rather change the mask format to {6} [999]
and store whole 4-digit values with prefixes.
Long story short, the meaning behind this prefix dictates the solution.
from input-mask-ios.
I have phonenumberfield that apply this mask "+7 ([999]) [999]-[99]-[99]" and value comes from backend like "1234567890" and output was "+7 (123) 456-78-90", but if I have seven in the first string "7234567890" output was like "+7 (234) 567-89-0", I need to mask can able to paste 10 digits from mask.
from input-mask-ios.
So basically the meaning behind the value returned from your backend is "phone number without the country code".
Thus, the country code itself is just a UI thing, and you've got to prefix all the values that are coming from your backend with 7
; the library will do the rest.
from input-mask-ios.
Feel free to reopen should you have any additional questions.
from input-mask-ios.
can you help me where I can fix that behavior, because I have multiple masks that comes from backend and I need to fill it correctly now I fix it only for phone number case.
from input-mask-ios.
Related Issues (20)
- can you add tailplaceholder as parameter, like MaskedTexfieldDelegate(primaryFormat: [99] / [99], isTailPlaceholderVisible: true) HOT 3
- Move the list of countries to an external file⦠maybe?
- Update the wikis
- Obtain text field value without input-mask HOT 1
- first number of format is wrong with prefix HOT 2
- Being able to use the `UITextField` delegates HOT 11
- First number of mask(#104) HOT 17
- Automatic Caps Lock Activation Issue in MaskedTextField HOT 7
- [Question] How do I initially fill in the mask having only symbols for blanks? HOT 10
- [Question] Character Limit HOT 2
- IOS Objective-C Programmatically example HOT 1
- [!] Unable to determine Swift version for the following pods HOT 1
- Unable to use with single textField HOT 2
- How to define ${dynamic amount }/month in input mask HOT 1
- How to write uppercased text? HOT 2
- Number Formatting (Thousand Separator) HOT 3
- Poor performance when user types fast HOT 3
- can you make mask template always visible while user input text HOT 2
- My repo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from input-mask-ios.