This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
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)

See Also:
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

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

Note You need to log in before you can comment on or make changes to this bug.