[TIMOB-15506] Android: ListView textfield inside headerView types backwards
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-10-18T18:49:13.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | 2013 Sprint 21, 2013 Sprint 21 API, Release 3.2.0 |
Components | Android |
Labels | api, module_listview, qe-testadded |
Reporter | Hieu Pham |
Assignee | Hieu Pham |
Created | 2013-10-16T22:50:57.000+0000 |
Updated | 2014-06-19T12:43:15.000+0000 |
Description
Test code:
var sections = [];
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
var fruitDataSet = [
{properties: { title: 'Apple', searchableText:' Fruits Apple', itemId:'0 0'}},
{properties: { title: 'Banana', searchableText:'Fruits Banana', itemId:'0 1'}},
{properties: { title: 'Cantaloupe', searchableText:'Fruits Cantaloupe', itemId:'0 2'}},
{properties: { title: 'Fig', searchableText:'Fruits Fig', itemId:'0 3'}},
{properties: { title: 'Guava', searchableText:'Fruits Guava', itemId:'0 4'}},
{properties: { title: 'Kiwi', searchableText:'Fruits Kiwi', itemId:'0 5'}},
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);
var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});
var vegDataSet = [
{properties: { title: 'Carrots', searchableText:'Vegetables Carrots', itemId:'1 0'}},
{properties: { title: 'Potatoes', searchableText:'Vegetables Potatoes', itemId:'1 1'}},
{properties: { title: 'Corn', searchableText:'Vegetables Corn', itemId:'1 2'}},
{properties: { title: 'Beans', searchableText:'Vegetables Beans', itemId:'1 3'}},
{properties: { title: 'Tomato', searchableText:'Vegetables Tomato', itemId:'1 4'}},
];
vegSection.setItems(vegDataSet);
sections.push(vegSection);
var fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});
var fishDataSet = [
{properties: { title: 'Cod', searchableText:'Fish Cod', itemId:'2 0'}},
{properties: { title: 'Haddock', searchableText:'Fish Haddock', itemId:'2 1'}},
{properties: { title: 'Salmon', searchableText:'Fish Salmon', itemId:'2 2'}},
{properties: { title: 'Tuna', searchableText:'Fish Tuna', itemId:'2 3'}},
];
fishSection.setItems(fishDataSet);
sections.push(fishSection);
var animalsSection = Ti.UI.createListSection({ headerTitle: 'Animals'});
var animalsDataSet = [
{properties: { title: 'Deer', searchableText:'Animals Deer', itemId:'3 0'}},
{properties: { title: 'Dog', searchableText:'Animals Dog', itemId:'3 1'}},
{properties: { title: 'Cat', searchableText:'Animals Cat', itemId:'3 2'}},
{properties: { title: 'Elephant', searchableText:'Animals Elephant', itemId:'3 3'}},
];
animalsSection.setItems(animalsDataSet);
sections.push(animalsSection);
var tf = Ti.UI.createTextField({
color: '#336699',
height: 100,
top:10,
bottom:10,
left:10,
right:10,
font:{fontSize:20,fontWeight:'bold'},
hintText: 'Search'
});
tf.addEventListener('change',function(e){
listView.searchText = e.value;
});
var button = Ti.UI.createButton({top: 100, title: "toggle caseInsensitive"});
button.addEventListener('click', function(e) {
if (listView.caseInsensitiveSearch) {
listView.caseInsensitiveSearch = false;
} else {
listView.caseInsensitiveSearch = true;
}
});
//The textfield must be a subview of the tableView to
//calculate correct contentInsets when keyboard is visible.
var listView = Ti.UI.createListView({top: 250, headerView: tf});
listView.sections = sections;
var win = Ti.UI.createWindow({windowSoftInputMode:Ti.UI.Android.SOFT_INPUT_ADJUST_PAN});
win.add(listView);
win.open();
1. Run code, focus the textfield and type 'apple'. Notice how the cursor is stuck at one position.
2. Hit back space to delete all letters, retype 'apple'. Then move cursor manually to position 2, between 'p' and 'l'. Type 'hello'. Notice how 'hello' is being written backwards
PR: https://github.com/appcelerator/titanium_mobile/pull/4797