Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15566] Android: TextField with KEYBOARD_NUMBERS_PUNCTUATION and autocorrect false does not allow punctuation

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-12-03T23:05:51.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterJon Alter
AssigneeSunila
Created2013-10-23T16:09:55.000+0000
Updated2017-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);

Comments

  1. Sunila 2013-11-26

    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
  2. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source