Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20423] iOS: KeyboardToolbar is not working well when there are more then one textfield

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2016-03-22T05:23:34.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterShuo Liang
AssigneeHans Knöchel
Created2016-02-18T03:14:17.000+0000
Updated2017-03-23T22:36:22.000+0000

Description

Reproduce Step:

1. Simply Run the code below 2. You will notice that when focus first textfield, the keyboardToolbar is not displaying, only a blank took bar. 3. But the second one works well. 4. If there is only one textfield, it works well too.
var win = Titanium.UI.createWindow({
    backgroundColor: 'white',
});
var view = Ti.UI.createView({
	top: 0,
});

// Textfield 1
var textfield1 = Ti.UI.createTextField({
	top: 20,
	hintText: "First Name",
});
view.add(textfield1);

// Textfield 2
var textfield2 = Ti.UI.createTextField({
	top: 100,
	hintText: "Second Name",
});
view.add(textfield2);

// Tool Button
var next = Titanium.UI.createButton({
	title: 'Next',
});
var prev = Ti.UI.createButton({
	title: 'Previous',
});
var done = Ti.UI.createButton({
	title: 'Done',
});
var flexSpace = Titanium.UI.createButton({
	systemButton: Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});

// create tool bar and add it into textfield
var toolbar1 = Ti.UI.iOS.createToolbar({
	items: [next, flexSpace, done],
});
var toolbar2 = Ti.UI.iOS.createToolbar({
	items: [prev, next, flexSpace, done],
});
textfield1.keyboardToolbar = toolbar1;
textfield2.keyboardToolbar = toolbar2;

win.add(view);

win.open();
Is there something wrong with test code? or a bug?

Comments

  1. Chee Kiat Ng 2016-02-22

    Can test and try on 5.2.0.RC?
  2. Hans Knöchel 2016-02-26

    Everyone: Did that work before, using older Ti-versions?
  3. Hans Knöchel 2016-02-26

    Update: The problem is, that you reference one button in two different toolbars. A simple fix is to create own buttons for each toolbar. Please let us know if that helps.
  4. Chee Kiat Ng 2016-03-22

    Closing as there's no fixes required to implement the above.
  5. Lee Morris 2017-03-23

    Closing ticket as Won't Fix with reference to the above comments.

JSON Source