Bug 280153. Often no visible focus when tree or list gets focus. r+a=mconnor
git-svn-id: svn://10.0.0.236/trunk@176548 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -228,7 +228,7 @@
|
||||
|
||||
<property name="currentIndex">
|
||||
<getter><![CDATA[
|
||||
return this.getIndexOfItem(this.currentItem);
|
||||
return this.currentItem ? this.getIndexOfItem(this.currentItem) : -1;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
if (val >= 0)
|
||||
@@ -504,6 +504,19 @@
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="focus">
|
||||
<![CDATA[
|
||||
if (this.currentIndex == -1 && this.getRowCount() > 0) {
|
||||
this.currentItem = getItemAtIndex(0); // focus first item
|
||||
if (this.selType != 'multiple') {
|
||||
// In single selection trees the selection should be the same
|
||||
// as the focus
|
||||
this.timedSelect(currentItem, this._selectDelay);
|
||||
}
|
||||
this.ensureIndexIsVisible(0);
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress" keycode="vk_up" phase="target">
|
||||
<![CDATA[
|
||||
if (this.selectedItems.length < 1)
|
||||
|
||||
@@ -246,7 +246,18 @@
|
||||
this.treeBoxObject.scrollByLines(rows);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="focus" action="this.treeBoxObject.focused = true;"/>
|
||||
<handler event="focus">
|
||||
<![CDATA[
|
||||
this.treeBoxObject.focused = true;
|
||||
if (this.currentIndex == -1 && this.view.rowCount > 0) {
|
||||
this.currentIndex = 0;
|
||||
if (this.view.selection.single) {
|
||||
this.view.selection.select(0);
|
||||
}
|
||||
this.treeBoxObject.ensureRowIsVisible(0);
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="blur" action="this.treeBoxObject.focused = false;"/>
|
||||
<handler event="keypress" keycode="vk_enter" action="this.changeOpenState(this.currentIndex);"/>
|
||||
<handler event="keypress" keycode="vk_return" action="this.changeOpenState(this.currentIndex);"/>
|
||||
|
||||
Reference in New Issue
Block a user