[Bug #847] Fix bug
check if the position is inside range before using it. FEA : ItEr71S04BugFixing
This commit is contained in:
parent
d5399c82a7
commit
a6978d55a8
1 changed files with 10 additions and 6 deletions
|
|
@ -378,7 +378,9 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
|
|||
Navigation navigation, Treerow treerow) {
|
||||
List<InputElement> boxes = getNavigableElements(treerow);
|
||||
int position = boxes.indexOf(inputElement);
|
||||
|
||||
if (position > boxes.size() - 1) {
|
||||
return;
|
||||
}
|
||||
switch (navigation) {
|
||||
case UP:
|
||||
focusGoUp(treerow, position);
|
||||
|
|
@ -518,11 +520,13 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
|
|||
private void focusCorrectBox(Treerow treerow, int position,
|
||||
Navigation whereIfDisabled) {
|
||||
List<InputElement> boxes = getNavigableElements(treerow);
|
||||
|
||||
if (boxes.get(position).isDisabled()) {
|
||||
moveFocusTo(boxes.get(position), whereIfDisabled, treerow);
|
||||
} else {
|
||||
boxes.get(position).focus();
|
||||
if (position < boxes.size() - 1) {
|
||||
if (boxes.get(position).isDisabled()) {
|
||||
moveFocusTo(boxes.get(position), whereIfDisabled,
|
||||
treerow);
|
||||
} else {
|
||||
boxes.get(position).focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue