Fix diappearance of text in CopyableLabel when clicking on it When the user clicks on a CopyableLabel the displayed label is replaced by an input box. In some cases the displayed input box has a visible length of 0 so that the contained text is not displayed. This happens when the text for the CopyableLabel is not set via the constructor but with the setText(...) method. The problem is that the member variable that holds the visible length is not updated when the setText(...) method is invoked. Bug: issue 1176 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java b/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java index 4393583..cdcfc19 100644 --- a/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java +++ b/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java
@@ -166,6 +166,7 @@ public void setText(final String newText) { text = newText; + visibleLen = newText.length(); if (textLabel != null) { textLabel.setText(getText());