diff options
author | Artur Signell <artur@vaadin.com> | 2013-02-19 22:05:21 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-02-19 22:05:21 +0200 |
commit | 696ef550ad583ac3c317704fcc093f87b78b64e4 (patch) | |
tree | 60581e6e3c819afec7fc55bca9eeaffb56ecf411 /client | |
parent | f09c12fd97cbafd10b31c79a55bd90dfef02f4a9 (diff) | |
download | vaadin-framework-696ef550ad583ac3c317704fcc093f87b78b64e4.tar.gz vaadin-framework-696ef550ad583ac3c317704fcc093f87b78b64e4.zip |
Ensure href is not set to "" when target is null (#10543)
A link with href="" causes a reload of the page, at least in Firefox.
Change-Id: I0d04615b3669d3b7ccab5bf0d45b6a665f32fb1e
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/link/LinkConnector.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/link/LinkConnector.java b/client/src/com/vaadin/client/ui/link/LinkConnector.java index 807a9bcc64..228897278e 100644 --- a/client/src/com/vaadin/client/ui/link/LinkConnector.java +++ b/client/src/com/vaadin/client/ui/link/LinkConnector.java @@ -42,7 +42,11 @@ public class LinkConnector extends AbstractComponentConnector implements @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { getWidget().src = getResourceUrl(LinkConstants.HREF_RESOURCE); - getWidget().anchor.setAttribute("href", getWidget().src); + if (getWidget().src == null) { + getWidget().anchor.removeAttribute("href"); + } else { + getWidget().anchor.setAttribute("href", getWidget().src); + } } }); } |