New issue
Advanced search Search tips

Issue 775897 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Paste popup is not destroyed after pasting from Cliptray

Reported by lge-systemwebview@lge.com, Oct 18 2017

Issue description

THIS TEMPLATE IS FOR FILING BUGS ON THE ANDROID SYSTEM WEBVIEW. GENERAL WEB
BUGS SHOULD BE FILED USING A DIFFERENT TEMPLATE!

Device name:LG G5
Android version:7.0
WebView version (from system settings -> Apps -> Android System WebView):61.0.3163.98
Application: LGEmail app using WebView
Application version: 6.81.17

URLs (if applicable):


Precondition:
Copy some text to Cliptray

Steps to reproduce:
(1) Launch LGEmail Composer 
(2) Long press on Body field (Paste popup is displayed)
(3) Click on Clip tray  option
(4) Select from clip tray and observe paste popup

Expected result: Paste popup should be dismissed


Actual result: Paste popup is not dismissed

Note: 
Issue not reproduced on WebView version: 60.0.3112.116 and it is reproduced on latest WebView version: 61.0.3163.98


 
Please find attached files
PastePopup_WebView_61.0.3163.98.mp4
2.1 MB View Download
PastePopup_WebView_60.0.3112.116.mp4
2.0 MB View Download

Comment 2 by ctzsm@chromium.org, Oct 18 2017

Cc: amaralp@chromium.org
amaralp@, how do you think, is this a real issue?
I'm noticing that the touch handle (the blue bubble that is used for dragging the selection caret around) isn't being shown in the M61 case. Is the handle always not being shown? Also what happens if there is some text and you long-press at the end of the text (to get an caret selection).
Is the handle always not being shown?
This issue is not about blue handle. But when long press/just tap on Empty line then  blue handle is not displayed(Reproducibility 3/5).

This issue is about PASTE and CLIP TRAY popup which is not dismissed even after pasting from clip tray.

Please find attached videos
PastePopup_WebView_61.0.3163.98.mp4  --> PASTE and CLIP TRAY popup is displayed even after pasting from CLIP TRAY
PastePopup_WebView_60.0.3112.116.mp4  --> PASTE and CLIP TRAY popup is dismissed after pasting from CLIP TRAY 



The popup is dismissed when the blue handle is dismissed. If the blue handle is not shown then it can't be dismissed and we are in a bad state. That is why I think the underlying problem is the lack of the handle. Does clicking "Paste" work as expected?

Comment 6 by ctzsm@chromium.org, Oct 21 2017

Labels: Needs-Feedback
Please find below answer for #c5 Does clicking "Paste" work as expected?
    Yes clicking on "Paste" is working as expected.
Project Member

Comment 8 by sheriffbot@chromium.org, Oct 23 2017

Cc: ctzsm@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "ctzsm@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: changwan@chromium.org
Components: Blink>Editing>Selection
Labels: -Type-Bug -Pri-3 Needs-Feedback Pri-2 Type-Bug-Regression
This is not reproducible on Gmail - I can see insertion handle pop up on long press. LG, could you provide us a way to reproduce this on nexus phone?

Comment 11 by yosin@chromium.org, Oct 25 2017

NextAction: 2017-11-06
Summary: NEEDS_FEEDBACK Paste popup is not destroyed after pasting from Cliptray (was: Paste popup is not destroyed after pasting from Cliptray)
In this scenarios custom ActionMode.Callback2 is used.
This issue cannot be reproduced on Nexus device as Clip tray feature is not available.

When blue handle is displayed and long press on Editor --> Click on Clip tray --> Paste from Clip tray then onDestroyActionMode() is called.
Please find below call stack:
java.lang.Exception
	at com.lge.email.richtextengine.selectionhandler.SelectActionModeCallback.onDestroyActionMode(SelectActionModeCallback.java:427)
	at com.android.internal.policy.DecorView$ActionModeCallback2Wrapper.onDestroyActionMode(DecorView.java:2470)
	at com.android.internal.view.FloatingActionMode.finish(FloatingActionMode.java:266)
	at org.chromium.content.browser.input.FloatingPastePopupMenu.hide(FloatingPastePopupMenu.java:21)
	at org.chromium.content.browser.SelectionPopupController.destroyPastePopup(SelectionPopupController.java:88)
	at org.chromium.content.browser.SelectionPopupController.onSelectionEvent(SelectionPopupController.java:396)
	at org.chromium.content.browser.webcontents.WebContentsImpl.nativeDismissTextHandles(Native Method)
	at org.chromium.content.browser.webcontents.WebContentsImpl.dismissTextHandles(WebContentsImpl.java:167)
	at org.chromium.content.browser.input.ImeAdapter.onImeEvent(ImeAdapter.java:124)
	at org.chromium.content.browser.input.ImeAdapter.sendKeyEvent(ImeAdapter.java:150)
	at org.chromium.content.browser.input.ThreadedInputConnection$14.run(ThreadedInputConnection.java:28)
	at android.os.Handler.handleCallback(Handler.java:789)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6695)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)

But if same steps executed when blue handle is not displayed then onDestroyActionMode() is not called

Note: The same is reproduced on Samsung Email app as it has Clipboard feature when long press on editor.
Project Member

Comment 13 by sheriffbot@chromium.org, Oct 26 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "changwan@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
From the crash stack in #12, the crash happened in app's code

com.lge.email.richtextengine.selectionhandler.SelectActionModeCallback.onDestroyActionMode(SelectActionModeCallback.java:427)

Could you check what happen in your side?

Comment 15 Deleted

Project Member

Comment 16 by sheriffbot@chromium.org, Oct 27 2017

Cc: michaelbai@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "michaelbai@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Just printing call stack. There is no crash.
SelectActionModeCallback.onDestroyActionMode() method is not called when blue handle is not displayed and pasted from clip tray.
Labels: Needs-Feedback
I don't think we can fix this as there is no way for us to debug it. And this only occurs on LG email.
LG should either provide a rooted phone or a reduced sample APK to repro this on a nexus phone.
Wait... michaelbai@ / ctzsm@, can we install a dev version webview and choose to use it from developer option on a non-rooted phone? I haven't tried this yet.
we can't do this for the local build APK.
Thanks for the quick answer, michaelbai@.

Ok, then LG will need to either provide a rooted phone or a reduced sample APK to repro this on a nexus phone.
We are trying to reproduce with Sample apk. Will update once it is reproduced
Project Member

Comment 23 by sheriffbot@chromium.org, Oct 31 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "changwan@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Whenever user clicks any item in clip tray window, we are calling inputConnection.performContextMenuAction(android.R.id.paste) to paste the content.
Content is pasted but the bubble popup is not dismissed in chrome webview  61.0.3163.98. But it was working till chrome webview  60.0.3112.107

Attached APK and sample code to reproduce on Nexus device.

WebViewSample.apk
1.5 MB Download
WebViewSampleApp_2.7z
1.2 MB Download
Owner: amaralp@chromium.org
Status: Assigned (was: Unconfirmed)
amaralp@, could you take a look?
Labels: Needs-Feedback
I'm not getting the cliptray option on my Nexus 6P. How do I get the cliptray on a Nexus device? Additionally the touch handle is always present when I do a long press. Is there a simpler apk that doesn't rely on the cliptray but doesn't show the touch handle? The underlying problem is the lack of the touch selection handle which might be unrelated to the cliptray.
You don't; it's an LG-specific feature.
I get the cliptray option from the sample app on Nexus 6P, however it is pretty much identical to "paste", there is no tray displayed.

I think it is intended to not show tray by checking the code of the sample app. And the ActionMenu is not dismissed as the bug described.
Labels: -Needs-Feedback
Disregard my comment #26. I can see the cliptray option and the bug is reproducing. I'm taking a look.
The NextAction date has arrived: 2017-11-06
Summary: Paste popup is not destroyed after pasting from Cliptray (was: NEEDS_FEEDBACK Paste popup is not destroyed after pasting from Cliptray)
In review http://crrev.com/c/757552
Project Member

Comment 32 by bugdroid1@chromium.org, Nov 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e55d1bb1d54e0cb898e2884213dc86aa2dc42270

commit e55d1bb1d54e0cb898e2884213dc86aa2dc42270
Author: Pedro Amaral <amaralp@chromium.org>
Date: Wed Nov 08 22:55:25 2017

Move dismissing handles on editing commands to Blink

Samsung's and LG's email apps override the action mode methods in
SelectionPopupController.java which leads to touch handles not being
dismissed on pasting/cutting which in turn causes bugs like the one
listed below. This CL moves the dismissing from SelectionPopupController
to Blink. Previously we always kept the handles when the selection
changed because of a command. Now the handles are only kept if the
resulting selection is a range selection.

Bug:  775897 
Change-Id: I54d58b1566fb536ff2007fd81b3e866140b834c9
Reviewed-on: https://chromium-review.googlesource.com/757552
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Pedro Amaral <amaralp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514984}
[modify] https://crrev.com/e55d1bb1d54e0cb898e2884213dc86aa2dc42270/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
[modify] https://crrev.com/e55d1bb1d54e0cb898e2884213dc86aa2dc42270/third_party/WebKit/Source/core/editing/Editor.cpp

NextAction: ----
Status: Fixed (was: Assigned)
I'm still able to reproduce this issue on LG V20 / NRD90M vs 61.0.3163.98 AND vs 64.0.3269.0 

I can only repro when body in compose email is empty, if it has some text, then I wasn't able to reproduce the issue. 




alekyoo@, you were able to repro on the sample apk? I can't repro on a Nexus 6P with the sample apk. Also was the insertion touch handle (the blue bulb right below the selection caret) showing before you performed the cliptray paste?
amaralp@, no, i used OEM email from LG with webview version: 64.0.3269.0 and was able to repro 100% 
Was the touch handle visible before you performed the cliptray paste?

Comment 38 Deleted

There are two separate issues here:

1) The first issue was that when a user long-pressed to get the "Paste, Cliptray" and the touch handle shows. After pasting from the Cliptray the handle is still showing and so is the floating menu. This is the case that is reproducible in the sample apk LG (this was also an issue in Samsung's email). My CL (the one in comment #32) fixed this problem.

2) The other issue is when the user long-presses and the touch handle is not shown. This can be reproduced 100% of the time in LG's email app when the email body is empty. It can't be reproduced on the sample apk. I've started a new bug to track this: crbug.com/786565
Tested in Chrome Dev 64.0.3271.3 Version. Issue is still reproducible with sample app and LGEmail app. 

Please let us know in which version this issue was fixed, we will verify once.

Sign in to add a comment