Comments (6)
I have the same use case. It would be nice to have this feature implemented in the lib.
from input-mask-ios.
Implemented in 3.4.0
.
Use ReversedMaskTextFieldDelegate
for your needs.
Unfortunately, you won't be able to use decimal format yet. I'll need some time to investigate that.
from input-mask-ios.
@joaolongo same here. Did you find any solution?
Using format: [90000]-[0000]
Getting: 12345-678
expected: 1234-5678
from input-mask-ios.
Hi @joaolongo and @DamascenoRafael,
Thanks for your question.
I think you should consider subclassing the MaskedTextFieldDelegateListener
for your needs, overriding these methods:
open func deleteText(
inRange range: NSRange,
inField field: UITextField
) -> (String, Bool)
and
open func modifyText(
inRange range: NSRange,
inField field: UITextField,
withText text: String
) -> (String, Bool)
You need to reverse the original text before applying the mask, and then reverse the result before assignment to the text field.
I didn't have an opportunity to try this myself, unfortunately. So, should you have any clarifying questions, please go ahead and ask them.
from input-mask-ios.
@DamascenoRafael
I did find a solution to this issue, but I had to implement a new pattern myself.
Here, try this:
https://gist.github.com/joaolongo/957a6e2826ce6edc0ad531d2f1081db3
from input-mask-ios.
Okay, I'm considering this as a feature candidate for future releases.
Please, stay tuned.
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?
- fix put when primaryMaskFormat "7 ([999])", if we use put("788", textfield) and if string first char is 7 mask will remove it, output: "7 88" HOT 8
- 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.