aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/themes/base/styles.css2
-rw-r--r--WebContent/VAADIN/themes/base/tree/tree.css2
-rw-r--r--WebContent/VAADIN/themes/liferay/styles.css2
-rw-r--r--WebContent/VAADIN/themes/reindeer/styles.css2
-rw-r--r--WebContent/VAADIN/themes/runo/styles.css2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java32
-rw-r--r--tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java2
7 files changed, 14 insertions, 30 deletions
diff --git a/WebContent/VAADIN/themes/base/styles.css b/WebContent/VAADIN/themes/base/styles.css
index aba8b88745..b726023e81 100644
--- a/WebContent/VAADIN/themes/base/styles.css
+++ b/WebContent/VAADIN/themes/base/styles.css
@@ -1972,7 +1972,7 @@ textarea.v-textarea-readonly:focus {
background: transparent url(common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
outline: none;
}
.v-tree-node-expanded {
diff --git a/WebContent/VAADIN/themes/base/tree/tree.css b/WebContent/VAADIN/themes/base/tree/tree.css
index aa01cf7770..9e056dc4d6 100644
--- a/WebContent/VAADIN/themes/base/tree/tree.css
+++ b/WebContent/VAADIN/themes/base/tree/tree.css
@@ -8,7 +8,7 @@
background: transparent url(../common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
outline: none;
}
.v-tree-node-expanded {
diff --git a/WebContent/VAADIN/themes/liferay/styles.css b/WebContent/VAADIN/themes/liferay/styles.css
index 87fc79aab3..7929641b83 100644
--- a/WebContent/VAADIN/themes/liferay/styles.css
+++ b/WebContent/VAADIN/themes/liferay/styles.css
@@ -1972,7 +1972,7 @@ textarea.v-textarea-readonly:focus {
background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
outline: none;
}
.v-tree-node-expanded {
diff --git a/WebContent/VAADIN/themes/reindeer/styles.css b/WebContent/VAADIN/themes/reindeer/styles.css
index 58a518ca0d..da73b51881 100644
--- a/WebContent/VAADIN/themes/reindeer/styles.css
+++ b/WebContent/VAADIN/themes/reindeer/styles.css
@@ -1972,7 +1972,7 @@ textarea.v-textarea-readonly:focus {
background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
outline: none;
}
.v-tree-node-expanded {
diff --git a/WebContent/VAADIN/themes/runo/styles.css b/WebContent/VAADIN/themes/runo/styles.css
index dcf99329f6..a9fb712eb2 100644
--- a/WebContent/VAADIN/themes/runo/styles.css
+++ b/WebContent/VAADIN/themes/runo/styles.css
@@ -1972,7 +1972,7 @@ textarea.v-textarea-readonly:focus {
background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
outline: none;
}
.v-tree-node-expanded {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index fb426d58cb..43915af3c9 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -625,19 +625,6 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
// always when clicking an item, focus it
setFocusedNode(this, false);
- /*
- * Also ensure that the Tree itself is also gains focus (TreeNodes
- * focus is kind of faked).
- */
- // if (BrowserInfo.get().isOpera()) {
- /*
- * focusing the tree in Opera would scroll long trees up on clicks
- */
- // getElement().focus();
- // } else if (!BrowserInfo.get().isIE()) {
- // focus();
- // } // else if IE: NOP, IE will give the focus to Tree anyways
-
ScheduledCommand command = new ScheduledCommand() {
public void execute() {
@@ -810,7 +797,6 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
} else {
focusedNode.setFocused(true);
}
- // focus();
}
final MouseEventDetails details = new MouseEventDetails(evt);
ScheduledCommand command = new ScheduledCommand() {
@@ -855,15 +841,7 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
DOM.appendChild(getElement(), ie6compatnode);
DOM.sinkEvents(ie6compatnode, Event.ONCLICK);
- } // else if (BrowserInfo.get().isOpera()) {
- /*
- * We need to focus the TreeNode itself to get keyboard navigation
- * to work in opera at some level. Actually focusing individual
- * TreeNodes would most likely be better option for all browsers, I
- * don't dare to to this at bugfix release. MT.
- */
- getElement().setTabIndex(-1);
- // }
+ }
nodeCaptionDiv = DOM.createDiv();
DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME
@@ -874,6 +852,12 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
DOM.appendChild(nodeCaptionDiv, wrapper);
DOM.appendChild(wrapper, nodeCaptionSpan);
+ /*
+ * Focus the caption div of the node to get keyboard navigation to
+ * work without scrolling up or down when focusing a node.
+ */
+ nodeCaptionDiv.setTabIndex(-1);
+
childNodeContainer = new FlowPanel();
childNodeContainer.setStyleName(CLASSNAME + "-children");
setWidget(childNodeContainer);
@@ -1165,7 +1149,7 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
ie6compatnode.addClassName(CLASSNAME_FOCUSED);
}
this.focused = focused;
- getElement().focus();
+ nodeCaptionDiv.focus();
treeHasFocus = true;
} else if (this.focused && !focused) {
nodeCaptionDiv.removeClassName(CLASSNAME_FOCUSED);
diff --git a/tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java b/tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java
index 30757735ed..3b8067c726 100644
--- a/tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java
+++ b/tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java
@@ -21,7 +21,7 @@ public class HugeWindowShouldBeClosable extends TestBase {
@Override
protected Integer getTicketNumber() {
- return -1;
+ return 6784;
}
}