From 696ef550ad583ac3c317704fcc093f87b78b64e4 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 19 Feb 2013 22:05:21 +0200 Subject: [PATCH] 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 --- client/src/com/vaadin/client/ui/link/LinkConnector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); + } } }); } -- 2.39.5