Can not mark the same content of browser page after copy
Marking a text on the web page and then press copy works, but trying to mark the same text again does not work. The reason for this is that the selection never gets cleared in webkit. The fix, calling cleaSelection in the onDestroyActionMode. Also added clearSelection when getting an onConfigurationChange. Change-Id: I59b384cb5441b6a3a05007ea7e77f9699889a87c
This commit is contained in:
committed by
Johan Redestig
parent
212af6dbd7
commit
2b3cef0dd7
@@ -137,7 +137,7 @@ class SelectActionModeCallback implements ActionMode.Callback {
|
||||
|
||||
@Override
|
||||
public void onDestroyActionMode(ActionMode mode) {
|
||||
mWebView.selectionDone();
|
||||
mWebView.clearSelection();
|
||||
}
|
||||
|
||||
private void setMenuVisibility(Menu menu, boolean visible, int resourceId) {
|
||||
|
||||
@@ -4478,6 +4478,13 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
||||
return selectText(x, y);
|
||||
}
|
||||
|
||||
public void clearSelection() {
|
||||
selectionDone();
|
||||
if (mWebViewCore != null) {
|
||||
mWebViewCore.sendMessage(EventHub.SELECT_TEXT, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the word at the indicated content coordinates.
|
||||
*/
|
||||
@@ -4495,7 +4502,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
mCachedOverlappingActionModeHeight = -1;
|
||||
if (mSelectingText && mOrientation != newConfig.orientation) {
|
||||
selectionDone();
|
||||
clearSelection();
|
||||
}
|
||||
mOrientation = newConfig.orientation;
|
||||
if (mWebViewCore != null && !mBlockWebkitViewMessages) {
|
||||
|
||||
Reference in New Issue
Block a user