Bug 46630 - [Xamarin.Forms, Android] Context menu of the Editor control is not working in the ListView
Summary: [Xamarin.Forms, Android] Context menu of the Editor control is not working in...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-09 11:47 UTC by Aleksandrs Vorobjovs
Modified: 2016-11-18 19:49 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Simple Editor context menu (110.45 KB, image/png)
2016-11-09 11:51 UTC, Aleksandrs Vorobjovs
Details
Editor in List context actions insted of text editor context menu (113.09 KB, image/png)
2016-11-09 11:51 UTC, Aleksandrs Vorobjovs
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Aleksandrs Vorobjovs 2016-11-09 11:47:52 UTC
Hello,

I have a Xamarin.Forms application. And I have an Editor control in a custon ViewCell in a ListView.

Usually, if a user makes a long press on an Editor control he/she has a text editor context menu (Select All, Copy, Paste and so on). 

But if an Editor control is in a ViewCell with ContextActions, then context actions appears when a user makes a long press on an Editor control, not a text editor context menu.

There is an example code of an Editor control is in a ViewCell with ContextActions:

{code}
<ListView x:Name="ItemList"
          ItemsSource="{Binding Items}"
          VerticalOptions="FillAndExpand" 
          HorizontalOptions="FillAndExpand"
          BackgroundColor="White"
          HasUnevenRows="True">
      
  <ListView.ItemTemplate>
    <DataTemplate>
      <ViewCell>

        <ViewCell.ContextActions>
          <MenuItem Text="Show" Command="{Binding ShowCommand}" CommandParameter="{Binding .}" />
          <MenuItem Text="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding .}" />
        </ViewCell.ContextActions>

        <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" Padding="16">
          <Label Text="{Binding Name}" HorizontalOptions="FillAndExpand" />
          <Editor Text="{Binding Description}" HorizontalOptions="FillAndExpand" HeightRequest="90" />
        </StackLayout>

      </ViewCell>
    </DataTemplate>
  </ListView.ItemTemplate>
</ListView>
{code}

And there are example screenshots of simple Editor context menu (XF_Android_SimpleEditor_ContextMenu.png) and Editor in List context actions insted of text editor context menu (XF_Android_EditorInList_ContextMenu.png).

Regards,
Aleksandrs Vorobjovs
Comment 1 Aleksandrs Vorobjovs 2016-11-09 11:51:12 UTC
Created attachment 18391 [details]
Simple Editor context menu
Comment 2 Aleksandrs Vorobjovs 2016-11-09 11:51:42 UTC
Created attachment 18392 [details]
Editor in List context actions insted of text editor context menu
Comment 3 Aleksandrs Vorobjovs 2016-11-09 12:07:18 UTC
This bug is related to the Xamarin.Forms on the Android platform only. On other platforms it works as expected: a text editor context menu is appearing in all cases.
Comment 4 adrianknight89 2016-11-18 02:20:31 UTC
What happens if you long press outside the Editor on other platforms? Do you see the context actions then?
Comment 5 adrianknight89 2016-11-18 04:13:07 UTC
See https://github.com/xamarin/Xamarin.Forms/pull/544
Comment 6 Rui Marinho 2016-11-18 19:49:53 UTC
Should be fixed in 2.3.4-pre1