Change CopyableLabel to hide onKeyUp
This changes the CopyableLabel to hide itself onKeyUp, after a copy, since hiding onKeyPress would hide the text box before Safari had a chance to copy it. Ultimately, the effect is the same, it just delays the processing a little further on. Bug: Issue 2635 Change-Id: I06a25b81c1da7286a09561732510fe4d6835a2a7
This commit is contained in:
@@ -22,6 +22,8 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
|||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.event.dom.client.KeyPressEvent;
|
import com.google.gwt.event.dom.client.KeyPressEvent;
|
||||||
import com.google.gwt.event.dom.client.KeyPressHandler;
|
import com.google.gwt.event.dom.client.KeyPressHandler;
|
||||||
|
import com.google.gwt.event.dom.client.KeyUpEvent;
|
||||||
|
import com.google.gwt.event.dom.client.KeyUpHandler;
|
||||||
import com.google.gwt.http.client.URL;
|
import com.google.gwt.http.client.URL;
|
||||||
import com.google.gwt.user.client.Command;
|
import com.google.gwt.user.client.Command;
|
||||||
import com.google.gwt.user.client.DOM;
|
import com.google.gwt.user.client.DOM;
|
||||||
@@ -189,9 +191,14 @@ public class CopyableLabel extends Composite implements HasText {
|
|||||||
switch (event.getCharCode()) {
|
switch (event.getCharCode()) {
|
||||||
case 'c':
|
case 'c':
|
||||||
case 'x':
|
case 'x':
|
||||||
Scheduler.get().scheduleDeferred(new Command() {
|
textBox.addKeyUpHandler(new KeyUpHandler() {
|
||||||
public void execute() {
|
@Override
|
||||||
hideTextBox();
|
public void onKeyUp(final KeyUpEvent event) {
|
||||||
|
Scheduler.get().scheduleDeferred(new Command() {
|
||||||
|
public void execute() {
|
||||||
|
hideTextBox();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user