PDA

View Full Version : [FIXED] [PR1] Moving from a textfield to a selectfield does not hide the keyboard



yoh.suzuki
10 Nov 2011, 2:06 PM
REQUIRED INFORMATION

Version:

Sencha Touch 2.0 PR1
Browser versions tested against:

Android 2.3
iPhone 3GS 4.3.5 Safari
DOCTYPE tested against:

<!DOCTYPE html>
Description:

When you go from a textfield to a selectfield, the keyboard should be hidden. Instead, the keyboard remains on the screen, covering up the picker.
Test Case:


Ext.setup({
onReady: function() {
Ext.Viewport.add(Ext.create('Ext.form.Panel', {
items: [
{
xtype:'fieldset',
title:'wut',
items:[
{ xtype: 'textfield', label: 'textfield' },
{ xtype:'selectfield', label: 'selectfield' }
]
}
]
}));
}
});

Jamie Avins
11 Nov 2011, 8:54 AM
Thank you for the report.

yoh.suzuki
29 Nov 2011, 6:53 PM
Additional note: The text field that originally had focus appears to still have focus. Sometimes it appears on top of the mask when the picker sheet is visible.

I need to bump this by saying that this bug still exists in PR2 and makes Android forms with select fields virtually unusable. Does anyone have a workaround?

A better example of this:


Ext.define('SelectModel', { extend: 'Ext.data.Model', fields: [ { name:'V', type:'int' },
{ name:'D', type:'string' }
]});


Ext.setup({
onReady: function() {
Ext.Viewport.add(Ext.create('Ext.form.Panel', {
items: [
{
xtype:'fieldset',
title:'wut',
items:[
{ xtype: 'textfield', label: 'textfield' },
Ext.create('Ext.form.Select', {
name: 'Select', valueField:'V', displayField:'D',
label: 'Select (incorrect)',
store: Ext.create('Ext.data.JsonStore', {
model: 'SelectModel',
data: [
{V: 0, D: 'Selection_0'},
{V: 1, D: 'Selection_1'},
{V: 2, D: 'Selection_2'}
]
})
})
]
}
]
}));
}
});

rdougan
1 Dec 2011, 3:37 PM
So, in the next release I have added Ext.hideKeyboard, and this will be called when you show a select field popup/picker. This should fix your issue.

yoh.suzuki
1 Dec 2011, 3:45 PM
That's fantastic! I've been hoping for a way to hide the keyboard. In fact, I couldn't figure out how to reliably do this with just JavaScript (without interfacing with a native call). I look forward to reading that code when PR3 or Beta is out.

However, I'm not sure this solves all of the problems. One of the weird things happening on Android is that the original text field is sometimes still blinking with focus under the mask. Sometimes a stray click brings that text field input above the mask. Sometimes a different stray click brings the masked input of the select field to focus above the mask and above the picker. I've got my fingers crossed that your fix solves these problems as well. I will test it when your fix is out.

rdougan
1 Dec 2011, 3:50 PM
Well, when you call hideKeyboard, it actually removes the focus from the current field too, so the cursor has been removed.

yoh.suzuki
1 Dec 2011, 3:53 PM
Awesome. Thank you!

florian.neumair
22 Oct 2012, 12:39 AM
I work with sencha touch 2.0.1.1 and i can to say it is fixed. If i go on Android from textfield to selectfield the keyboard is not hidden.