Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19725] iOS: Toggled action buttons display over keyboard

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-02-06T00:49:11.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.2.0
ComponentsiOS
Labelsqe-5.1.0, qe-5.2.0
ReporterEric Wieber
AssigneeAngel Petkov
Created2015-10-14T17:40:49.000+0000
Updated2016-02-06T00:50:23.000+0000

Description

When all the action buttons are removed from above the keyboard and a keyboard button is pushed, the bar for the action buttons is hidden. If the action buttons are then toggled back on, they display on top of the keyboard. See attached gif: !toggleoverlay.gif|thumbnail! Example code:
var showUndoRedoActionsField = true;

var win = Ti.UI.createWindow({backgroundColor: "#fff",layout: "vertical"});
var field = Ti.UI.createTextArea({width: 300,height: 50,top: 100,backgroundColor: "#f0f0f0",value: "Hello" ,showUndoRedoActions:true});
var btn1 = Ti.UI.createButton({title: "Toggle field"});

field.autocorrect = false;
//field.showUndoRedoActions = showUndoRedoActionsField;

btn1.addEventListener("click", function() {
    showUndoRedoActionsField = !showUndoRedoActionsField;
    field.showUndoRedoActions = showUndoRedoActionsField;
});

win.add(field);
win.add(btn1);
win.open();
*Steps to reproduce issue* 1. Launch an app using the above code on an iPad 2. Click on the textfield 3. Click the 'Toggle Field' button 4. Click any key on the keyboard 5. Click the 'Toggle Field' button *Actual Results* The action buttons are shown on top of the keyboard *Expected Results* The action button bar appears and contains the action buttons *Notes* This could be an iOS issue

Attachments

FileDateSize
toggleoverlay.gif2015-10-14T17:39:10.000+0000132487

Comments

  1. Angel Petkov 2015-11-26

    PR pending https://github.com/appcelerator/titanium_mobile/pull/7499/files.
  2. Chee Kiat Ng 2015-11-27

    CR and FT passed. PR Merged. New sample code to test:
       var win = Ti.UI.createWindow({backgroundColor: "#fff",layout: "vertical"});
       var field = Ti.UI.createTextArea({width: 300,height: 50,top: 100,backgroundColor: "#f0f0f0",showUndoRedoActions: true,value: "Hello"});
       field.autocorrect = false;
        
       win.add(field);
       win.open();
       

    Steps to test

    test with field property (During creation) showUndoRedoActions set to true, false, and not setting this property.
  3. Harry Bryant 2016-01-22

    Upon testing this issue with the latest components, it was found that the demo code can no longer produce the UndoRedo actions. A resolution is currently in working progress. Tested on: iPhone 6s Plus Device (9.2) & iPhone 6 Plus Device (8.4) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.2.0.v20160114021251 Appc NPM: 4.2.3-1 App CLI: 5.2.0-231 Xcode 7.2 Node v4.2.3 *Reopening Ticket.*
  4. Harry Bryant 2016-01-25

    Update: Upon initial testing, i did not realise that this feature was an iPad only feature. However, after testing with an iPad pro, receive the following error:
       [ERROR] Script Error {
       [ERROR]     column = 126;
       [ERROR]     line = 1;
       [ERROR]     message = "Only run on the main thread!";
       [ERROR]     sourceURL = "file:///var/mobile/Containers/Bundle/Application/E82A7218-111A-4E64-A18B-EFEADF946E88/undoRedo.app/app.js";
       [ERROR]     stack = "[native code]\nglobal code@file:///var/mobile/Containers/Bundle/Application/E82A7218-111A-4E64-A18B-EFEADF946E88/undoRedo.app/app.js:1:126";
       [ERROR] } 
       
    The resolution to this fix is to include the tag in the tiapp.xml: <run-on-main-thread>true</run-on-main-thread> under . The fix for this issue should be that new projects created with the latest SDK should automatically generate this code in the tiapp.xml.
  5. Eric Wieber 2016-02-03

    Reopening this ticket. As of 5.2.0, <run-on-main-thread>true</run-on-main-thread> is not present by default, so this error persists. Tested using: MacOS 10.11.3 (15D21) Studio 4.5.0.201601262138 Ti SDK 5.2.0.v20160202103508 Appc NPM 4.2.3-1 Appc CLI 5.2.0-239 Alloy 1.7.33 Xcode 7.2 (7C68)
  6. Angel Petkov 2016-02-03

    PR pending : https://github.com/appcelerator/titanium_mobile/pull/7674.
  7. Chee Kiat Ng 2016-02-04

    CR and FT passed. Need a 5_2_X back port please.
  8. Angel Petkov 2016-02-04

    PR(5_2_X) : https://github.com/appcelerator/titanium_mobile/pull/7678
  9. Chee Kiat Ng 2016-02-04

    PRs merged!
  10. Eric Wieber 2016-02-05

    Reopening. I no longer encounter the "Only run on main thread" error on iPads. However, like [~htbryant] stated before, the UndoButtons can no longer be toggled. Use the code provided in the ticket body, in a classic app, and try to toggle the buttons. This technically does solve the main issue as you can not toggle the buttons, but is this the intended solution? MacOS 10.11.3 (15D21) Studio 4.5.0.201602050824 Ti SDK 5.2.0.v20160205071936 Appc NPM 4.2.3-1 Appc CLI 5.2.0-247 Alloy 1.7.33 Xcode 7.2 (7C68) iOS 9.2, iPad Pro simulator, iPad Air 2 simulator
  11. Chee Kiat Ng 2016-02-06

    Hi, This property can only be set during creation. Please see apidocs.
          - name: showUndoRedoActions
            summary: Determinates if the undo and redo buttons on the left side of the keyboard should be displayed or not. Only valid on iOS9 and above. This property can only be set upon creation.
            type: Boolean
            default: true
            platforms: [ipad]
            osver: {ios: {min: "9.0"}}
            since: 5.0.0
        
  12. Eric Wieber 2016-02-06

    Thanks [~cng]. In light of that, closing as fixed. Verified with above environment and sample code(s) provided.

JSON Source