maui icon indicating copy to clipboard operation
maui copied to clipboard

[iOS] ImageButton in FlexLayout not clickable

Open IndexOutOfLimit opened this issue 2 years ago • 3 comments

Description

We have FlexLayout kept inside a Grid and DataTemplate for FlexLayout is a ImageButton. Now Imagebutton clickevent or Command not firing for iOS only. It is working on Android and Windows.

Steps to Reproduce

  1. Create Maui project.
  2. Create a ContentView as below:

<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TestAttachments.ViewAttachment" >

<Grid x:Name="AttachmentsGalleryGrid" Style="{StaticResource AttachmentsGalleryGrid}" >
    <FlexLayout  x:Name="flexLayout" Direction="Row" AlignContent="Start" AlignItems="Start" HorizontalOptions="StartAndExpand" 
                 JustifyContent="Start" Wrap="Wrap" BindableLayout.ItemsSource="{Binding AttachmentList}">
            <BindableLayout.ItemTemplate>
                <DataTemplate>
                <ImageButton Source ="{Binding . }" Clicked="OnThumbnailTapped"  Aspect="AspectFill" 
                                     Style="{StaticResource AttachmentsGalleryItem}" />
            </DataTemplate>                    
            </BindableLayout.ItemTemplate>
        </FlexLayout>
    <Label x:Name="GalleryItem"/>
</Grid>    
  1. See Click Event not firing for Imagebutton

Link to public reproduction project repository

NA

Version with bug

6.0 Release Candidate 3

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS

Did you find any workaround?

Not yet. Looked at https://github.com/dotnet/maui/issues/3435 and tried to apply the same. Didn't work for iOS

Relevant log output

No response

IndexOutOfLimit avatar Nov 14 '22 09:11 IndexOutOfLimit

Hi @IndexOutOfLimit. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Nov 14 '22 15:11 ghost

Hi @IndexOutOfLimit. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Nov 14 '22 15:11 ghost

I am using below Visual Studio configurations which I think not too much old:

Visual Studio Professional 2022 for Mac Preview Version 17.4 Preview (17.4 build 2339) Installation UUID: c6b47ff7-95e2-49a4-a7de-e771700da465

Runtime .NET 6.0.9 (64-bit) Architecture: Arm64

Roslyn (Language Service) 4.4.0-3.22505.14+53c4590aabe91a32e33324c5095f7e9ee41dbf78

NuGet Version: 6.3.1.1

.NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/7.0.100-rc.2.22477.23/Sdks SDK Versions: 7.0.100-rc.2.22477.23 6.0.402 MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 7.0.0-rc.2.22472.3 6.0.10

Xamarin.Profiler Version: 1.8.0.19 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater Version: 11

Apple Developer Tools Xcode 14.0.1 (21336) Build 14A400

Xamarin.Android Version: 13.1.0.1 (Visual Studio Professional) Commit: xamarin-android/d17-4/13ba222 Android SDK: /Users/gopalbhageria/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 12.0 (API level 31) 13.0 (API level 33)

SDK Command-line Tools Version: 7.0 SDK Platform Tools Version: 33.0.2 SDK Build Tools Version: 32.0.0

Build Information: Mono: a96bde9 Java.Interop: xamarin/java.interop/d17-4@fcc33ce2 SQLite: xamarin/sqlite/3.39.3@23e1ae7 Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a

Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.12 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager Version: 17.4.0.54 Hash: 6eabb9e Branch: remotes/origin/d17-4 Build date: 2022-10-20 22:14:37 UTC

Android Device Manager Version: 0.0.0.1206 Hash: 886af39 Branch: 886af39 Build date: 2022-10-20 22:14:37 UTC

Xamarin.Mac Version: 8.12.0.2 (Visual Studio Professional) Hash: 87f98a75e Branch: d17-3 Build date: 2022-07-25 20:18:54-0400

Xamarin.iOS Version: 16.0.0.72 (Visual Studio Professional) Hash: 6756a1146 Branch: release/6.0.4xx-xcode14 Build date: 2022-09-21 08:51:06-0400

Xamarin Designer Version: 17.4.0.136 Hash: d49c9ff6d3 Branch: remotes/origin/d17-4 Build date: 2022-10-20 22:14:32 UTC

Build Information Release ID: 1704002339 Git revision: 6be3e052a8e0f67b543f4ffc6d23094ed1dd9b9e Build date: 2022-10-20 22:11:54+00 Build branch: release-17.4 Build lane: release-17.4

Operating System Mac OS X 12.6.0 Darwin 21.6.0 Darwin Kernel Version 21.6.0 Mon Aug 22 20:20:07 PDT 2022 root:xnu-8020.140.49~2/RELEASE_ARM64_T8110 arm64

IndexOutOfLimit avatar Nov 14 '22 16:11 IndexOutOfLimit

I believe they're looking for a sample project where you can reproduce this issue. So, please go ahead and create a project with your issue, upload that to a new GitHub repo and share the link of that repo here so they can help you better.

akhanalcs avatar Nov 14 '22 20:11 akhanalcs

I've updated the Visual Studio and it seems to be working now. Ticket can be closed, Thanks

IndexOutOfLimit avatar Nov 16 '22 12:11 IndexOutOfLimit