[TIMOB-15926] iOS: Removing a TextField without blur results in layout issue
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2017-07-10T21:35:59.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Martin Guillon |
Assignee | Eric Merriman |
Created | 2012-12-26T09:48:38.000+0000 |
Updated | 2017-07-10T21:36:03.000+0000 |
Description
*Steps to reproduce*
1. TextField in a ScrollView (same with TableView)
2. Focus the TextField
3. Remove the ScrollView without sending blur to the TextField
4. Add the ScrollView again
5. Observe layout bug
*Test case*
var win = Titanium.UI.createWindow();
win.backgroundColor = '#ccc';
var view4 = Ti.UI.createView({
top : 1,
left : 5,
right : 5,
height : 200,
backgroundColor : 'black',
layout : 'vertical'
})
var scrollView = Titanium.UI.createScrollView({
top : 0,
height : 50,
layout : 'vertical'
});
var button1 = Titanium.UI.createButton({
top : 5,
width : 130,
height : 40,
title : 'unfocus'
});
button1.addEventListener('click', function() {
textfield.blur();
});
var button2 = Titanium.UI.createButton({
top : 5,
width : 130,
height : 40,
title : 'show/hide'
});
button2.addEventListener('click', onClick);
var view = Ti.UI.createView({
backgroundColor : 'blue',
top : 5,
height : 30,
bottom : 5,
layout : 'horizontal',
horizontalWrap : 'false',
width : Ti.UI.FILL
})
view.add(Ti.UI.createLabel({
left : 0,
width : 130
}))
var textfield = Ti.UI.createTextField({
left : 5,
right : 5,
height : 35,
value : "test",
backgroundColor : 'red',
width : Ti.UI.FILL
})
view.add(textfield)
scrollView.add(view);
view4.add(scrollView);
view4.add(button1);
view4.add(button2);
var button = Titanium.UI.createButton({
title : 'show/hide',
height : 40,
width : 200,
bottom : 10
});
win.add(button);
var added = false;
function onClick() {
if (added) {
win.remove(view4);
} else {
win.add(view4);
textfield.focus();
}
added = !added;
}
button.addEventListener('click', onClick);
win.open();
Hello, What are the steps to reproduce? I tried with the sample code, but I can't see anything weird. What should I see?
@Davide: just 1 open 2 click show/hide at the bottom 3 without doing unfocus click show/hide in the "dialog view. 4 click show/hide at the bottom => the textfield is out of place. Do the same thing by adding 3.a unfocus, and it will behave correctly I just did it in the ios simulator 6.0 with sdk 3.0.0.GA
I am unable to reproduce this issue with the following environment; iPhone 6 (10.0) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131