Issue metadata
Sign in to add a comment
|
Default copy paste options appear when text selection is changed even though it was cleared when action was started.
Reported by
amaheshw...@uworld.com,
Sep 28 2017
|
||||||||||||||||||||||
Issue descriptionTHIS TEMPLATE IS FOR FILING BUGS ON THE ANDROID SYSTEM WEBVIEW. GENERAL WEB BUGS SHOULD BE FILED USING A DIFFERENT TEMPLATE! Device name: Samsung S8 Android version: 7.0.0 WebView version (from system settings -> Apps -> Android System WebView): 61.0 Application:Uworld SAT Application version: 2.5 URLs (if applicable): Steps to reproduce: (1) Login to application (2) enter into any subscription (3) Launch a test (4) start text selection anywhere (5) you will see custom menu items on floating toolbar (6) now extend the text selection by moving tracking balls Expected result: Should be able to see only previous menu items Actual result: Default menu items Copy, Paste share ,web search are getting appended to custom menu items
,
Sep 29 2017
,
Sep 29 2017
video + bugreport/logs please
,
Oct 2 2017
Hi, I have created test application to reproduce the webview issue(Please check attachment). It replicates our webview and actionmode implementation. Please feel free to access it and modify to provide solution. Also I have attached video that shows mentioned issue.
,
Oct 2 2017
hi, Please find attached source code of above test application.
,
Oct 3 2017
Re-tested the issue with the above mentioned test file, still the test application is getting crashed on older M59, M60 Builds. Hence unable to find the regression range. Please find the log's and video's (Both Repro and Crash) of the issue-- here go/chrome-androidlogs/769974- Thanks!!
,
Oct 3 2017
Hi, I tested on 59.0. I couldn't find any crash, also I could not reproduce issue in this version. Please check attached screenshot. Requesting to you please provide the fix as soon as possible. Thanks.
,
Oct 5 2017
Shimi, perhaps selection related? Can you see if this is still an issue on the latest WebView?
,
Oct 5 2017
I believe the problem is that when the selection is extended we invalidate the action mode. When we do the invalidation we re-populate the menu and add back the items that were previously removed. You can get around this by overriding View.startActionMode() and passing in your own callback.
,
Oct 5 2017
Hi, I already tried above work-around of passing my own callback. But I still see floating default copy and selectall options. Please see attached videos and source code. However I was able to remove Share and Websearch using webview settings: webView.getSettings().setDisabledActionModeMenuItems(WebSettings.MENU_ITEM_SHARE + WebSettings.MENU_ITEM_WEB_SEARCH); Requesting you please prioritize and provide solution as soon as possible as our product release is getting delayed due to this issue.
,
Oct 5 2017
I think you misunderstood what I meant by overriding startActionMode(). I meant for you to subclass android.webkit.WebView (let's call the subclass MyWebView) and override the startActionMode() methods there. Then in your xml layout instead of having a WebView element you'd have a MyWebView element.
,
Oct 5 2017
I tried above solution but still not able to resolve the issue. Please find attached source code. Please feel free to modify the source code if you know the solution.
,
Oct 6 2017
amaheshwari@, please find the attached example.
,
Oct 9 2017
Hi, thank you for workaround, above solution works for us. But is this issue going to fixed in future release?
,
Oct 9 2017
changwan@, It seems we regressed a way some apps, such as the one in this crbug, used to change selection menu items, the reason is mentioned in #9. There is another way to do so in the example I was given in #13 though. I am not sure if we need to support the old way actually, it doesn't make sense to me to just add a listener and overriding action mode related APIs in Activity level either.
,
Oct 10 2017
Could you pinpoint the regressing CL? If this issue does not happen on a native textview/edittext, I tend to think that it is a regression that needs fixing. amaralp@, could you check how the textview avoids this issue?
,
Oct 10 2017
There is a similar problem with TextView - the "Select All" option is still available even after the first long-press. The issue is that what menu items are shown depend on the selection so whenever the selection changes the action mode is invalidated and the menu items are reset. amaheshwari@, is there an issue with ctzsm@'s suggestion? That is the way many WebView apps customize the action mode.
,
Oct 10 2017
amaralp@, Callback2 is supported from API 24 and above. Our app support starts from API 19 and above. So we had to override both callback and callback2 action modes. This solution works for us. But if this issue is really a bug, then can we not fix it for future release so we don't have to override all callbacks?
,
Oct 10 2017
This issue isn't a bug. You would have a similar problem in TextView (the "Select All" option would be present). The problem is that when a selection changes the menu items might also change so we re-create the entire menu when an invalidation occurs. Please go ahead and override both callbacks on your future releases. Thanks!
,
Oct 16 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by sandeepkumars@chromium.org
, Sep 29 2017Labels: -Type-Bug -Pri-3 Needs-triage-Mobile Triaged-Mobile M-63 Pri-1 Type-Bug-Regression