Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19939] keyboardType should not list KEYBOARD_APPEARANCE_* constants

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-11-24T19:24:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.2.0
ComponentsiOS
Labelsqe-5.2.0
ReporterFokke Zandbergen
AssigneeAngel Petkov
Created2015-11-12T13:15:16.000+0000
Updated2016-01-22T00:42:51.000+0000

Description

The different places where we have the keyboardType property all list the two KEYBOARD_APPEARANCE_* constants as valid values, although these are only valid for the appearance property. * http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextField-property-keyboardType * http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextArea-property-keyboardType * http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog-property-keyboardType * http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog-property-loginKeyboardType * http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog-property-passwordKeyboardType This is because in the YML's we use KEYBOARD_* wildcards: https://github.com/appcelerator/titanium_mobile/search?q=KEYBOARD_* Unless we can make exceptions we should either:

List each of them manually

Rename the constants for keyboardType to KEYBOARD_TYPE_*

I'm for the second option; deprecate in next 5.x and remove the old in 6.0. That's why I've created this ticket in TIMOB instead of TIDOC.

Comments

  1. Angel Petkov 2015-11-17

    PR pending https://github.com/appcelerator/titanium_mobile/pull/7459/files Demo Code:
       Ti.UI.setBackgroundColor('white');
       var win = Ti.UI.createWindow({
         title: 'Click window to test'
       });
       
       var field = Ti.UI.createTextArea({
         width           : 300,
         height          : 50,
         top             : 200,
         right           : 0 ,
         backgroundColor : "#f0f0f0",
         value           : "Hello",
         keyboardType : Titanium.UI.KEYBOARD_ASCII,
         appearance: Titanium.UI.KEYBOARD_APPEARANCE_LIGHT,
       });
       
       
        var textField = Ti.UI.createTextField({
           borderStyle   : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
         color           : '#336699',
         top             : 100, 
         right           : 0,
         width           : 250, 
         height          : 60,
         backgroundColor :'Green',
         keyboardType    : Titanium.UI.KEYBOARD_TWITTER,
         appearance      : Titanium.UI.KEYBOARD_APPEARANCE_DARK
       });
       
       var search = Titanium.UI.createSearchBar({
           barColor            :'#000', 
           showCancel          :true,
           height              :43,
           top                 :20,
           left                :0,
           keyboardType        : Titanium.UI.KEYBOARD_TYPE_URL,
           keyboardAppearance  : Titanium.UI.KEYBOARD_APPEARANCE_DARK
       });
       field.autocorrect = false;
       
       win.add(textField);
       win.add(field);
       win.add(search);
       win.open();
       
    Expected Results : A warning stating that keyboard_twitter and keyboard_ASCII is deprecated. A warning stating that appearance is deprecated in favor of keyboardApperance.
  2. Hans Knöchel 2015-11-24

    CR + FT passed. The following logs appear as supposed to:
       [WARN] Titanium.UI.KEYBOARD_ASCII DEPRECATED in 5.2.0, in favor of UI.KEYBOARD_TYPE_ASCII.
       [WARN] Titanium.UI.KEYBOARD_TWITTER DEPRECATED in 5.2.0, in favor of UI.KEYBOARD_TYPE_TWITTER.
       [WARN] Titanium.UI.TextField.appearance DEPRECATED in 5.2.0, in favor of UI.TextField.keyboardAppearance.
       [WARN] Titanium.UI.TextArea.appearance DEPRECATED in 5.2.0, in favor of UI.TextArea.keyboardAppearance.
       
    PR approved!
  3. Harry Bryant 2016-01-20

    Verified as fixed, with SDK 5.2.0.v20160114021251 Receive DEPRECATED warning messages in console as per the expected results. Tested on: iPhone 6s Plus Device (9.2) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.2.0.v20160114021251 Appc NPM: 4.2.2 App CLI: 5.2.0-220 Xcode 7.2 Node v4.2.3 Closing Ticket.

JSON Source