Thank you for reporting this bug. We will make it our priority to review this report.
-
Ext User
[FNR] TabPanel key navigation
Hello!
I just noticed that there's key navigation in TabPanel and it seems to be nice feature.
But there're some problems with nested elements:
Code:
Window window = new Window();
window.setLayout(new FitLayout());
window.setSize(600, 500);
TabPanel tabPanel = new TabPanel();
TabItem firstItem = new TabItem("First item");
FormPanel formPanel = new FormPanel();
TextField<String> field = new TextField<String>();
formPanel.add(field);
firstItem.add(formPanel);
tabPanel.add(firstItem);
TabItem secondItem = new TabItem("Second item");
tabPanel.add(secondItem);
window.add(tabPanel);
window.show();
Steps to reproduce:
1. Click in the field.
2. Type something.
3. Press "Home" - cursor moves to the beginning of the text.
4. Now press "End"
We expect that cursor moves to the end of the text in the field, but unfortunately TabPanel catches the event and opens "Second tab".
So TabPanel receives events that must be received only by the field currently focused.
If it is not a bug, please tell me how to solve this problem.
Thanks!
-
Sencha User
This bug is fixed in the releases/2.1 branch and is now available in the 2.1.1-beta release available here.
-
Sencha User
There is another problem when you have TabPanels nested inside other TabPanels. If the user presses HOME/END button all the nested TabPanels will switch to their own first/last TabItem.
A stopEvent() is required in TabPanel.onKeyPress() in order to stop the event from being propagated to parent elements.
The stopEvent() is already used for PAGEDOWN/PAGEUP in onRight()/onLeft(), but was missed for HOME/END buttons.
Thank you.
-
Ext GWT Premium Member
Hi..
Has anyone found a workaround for the HOME/END issue above? Causing me a few problems now.
Thanks
-
Ext User
I just deleted (overrided) the HOME/END pairs from TabPanel.onKeyPress().
Code:
@Override
protected void onKeyPress(final ComponentEvent pCe) {
final int code = pCe.getKeyCode();
switch (code) {
case KeyCodes.KEY_RIGHT:
case KeyCodes.KEY_PAGEDOWN:
this.onRight(pCe);
break;
case KeyCodes.KEY_LEFT:
case KeyCodes.KEY_PAGEUP:
this.onLeft(pCe);
break;
// Removed End and Home key preferences, whiches cause input fields inconsistency
}
}
-
This should already be fixed in SVN for GXT 2.2