[TIMOB-15566] Android: TextField with KEYBOARD_NUMBERS_PUNCTUATION and autocorrect false does not allow punctuation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-12-03T23:05:51.000+0000 |
Affected Version/s | Release 3.1.3 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Jon Alter |
Assignee | Sunila |
Created | 2013-10-23T16:09:55.000+0000 |
Updated | 2017-03-16T21:01:00.000+0000 |
Description
Setting KEYBOARD_NUMBERS_PUNCTUATION on the keyboardType property of a textField along with "autocorrect: false" causes punctuation to not be accepted.
Steps to reproduce:
1. Run the code below. 2. Try typing punctuation in the textField. 3. Notice that punctuation does not show up, only numbers. 4. remove 'autocorrect: false'. 5. Run the test again. 6. Notice that it is now possible to add punctuation. autocorrect also causes problems when the keyboardType is set to KEYBOARD_DECIMAL_PAD 7. Change KEYBOARD_NUMBERS_PUNCTUATION to KEYBOARD_DECIMAL_PAD. 8. Try it with and without autocorrect set to false. 9. Notice that when autocorrect is false, it is only possible to add a single decimal point (this may be expected behavior but it is not consistent with iOS). 10. Notice that when autocorrect is removed, it is possible to add any punctuation (this is not correct).Repro case:
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
win.open();
var ipAddress = Ti.UI.createTextField({
hintText: 'IP Address',
top: 10, left: 10, right: 10,
height: 40,
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
autocorrect: false,
keyboardType: Ti.UI.KEYBOARD_NUMBERS_PUNCTUATION
});
win.add(ipAddress);
Make sure that InputType.TYPE_CLASS_TEXT is added for number punctuation no matter autocorrect is true or false and also do not set InputType.TYPE_CLASS_TEXT for KEYBOARD_DECIMAL_PAD. https://github.com/appcelerator/titanium_mobile/pull/5026
Closing ticket as fixed.