Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Desktop/Desktop WSL] Events Not Triggered When Using Image #18528

Open
agneszitte opened this issue Oct 21, 2024 · 1 comment · May be fixed by #18561
Open

[Desktop/Desktop WSL] Events Not Triggered When Using Image #18528

agneszitte opened this issue Oct 21, 2024 · 1 comment · May be fixed by #18561
Assignees
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers kind/bug Something isn't working project/input ⌨️ Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...) project/media 📺 Categorizes an issue or PR as relevant to media (MediaPlayer, WebView, PDF, Image, …)

Comments

@agneszitte
Copy link
Contributor

agneszitte commented Oct 21, 2024

Current behavior

When using Tapped, DoubleTapped, PointerPressed,... events on an Image, the event is not triggered on Desktop or Desktop WSL. However, the same events are working as expected on other controls such as Border for example.

Expected behavior

The Tapped, DoubleTapped, PointerPressed,... events should be triggered when interacting with an Image, similar to how they work with other UI elements like Border or to how they work for all the other platforms.

How to reproduce it (as minimally and precisely as possible)

Sample App to Repro: TappedEventIssue.zip

Create a new project with the following XAML and C# code:

<Grid>
  <StackPanel Spacing="10"
              HorizontalAlignment="Center"
              VerticalAlignment="Center">
    <TextBlock Text="Hello Uno Platform!"
               HorizontalAlignment="Center" />

    <Border Height="100"
            Width="100"
            Background="LightBlue"
            Tapped="Tapped_Event">
      <TextBlock Text="Tapped Test"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center" />
    </Border>

    <Image Height="100"
           Tapped="Tapped_Event"
           Source="ms-appx:///Assets/unologo.jpg" />

    <Border Height="100"
            Width="100"
            Background="LightPink"
            DoubleTapped="DoubleTapped_Event">
      <TextBlock Text="DoubleTapped Test"
                 HorizontalTextAlignment="Center"
                 TextWrapping="WrapWholeWords"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center" />
    </Border>

    <Image Height="100"
           DoubleTapped="DoubleTapped_Event"
           Source="ms-appx:///Assets/unologo.jpg" />

    <Border Height="100"
            Width="100"
            Background="LightGreen"
            PointerPressed="PointerPressed_Event">
      <TextBlock Text="PointerPressed Test"
                 HorizontalTextAlignment="Center"
                 TextWrapping="WrapWholeWords"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center" />
    </Border>

    <Image Height="100"
           PointerPressed="PointerPressed_Event"
           Source="ms-appx:///Assets/unologo.jpg" />
  </StackPanel>
</Grid>
private async void Tapped_Event(object sender, Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e)
{
    ContentDialog dialog = new ContentDialog
    {
        Title = "Tapped Event",
        Content = "Tapped Event succeeded!",
        PrimaryButtonText = "OK",
        XamlRoot = this.XamlRoot
    };

    await dialog.ShowAsync();
}

private async void DoubleTapped_Event(object sender, Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs e)
{
    ContentDialog dialog = new ContentDialog
    {
        Title = "DoubleTapped Event",
        Content = "DoubleTapped Event succeeded!",
        PrimaryButtonText = "OK",
        XamlRoot = this.XamlRoot
    };

    await dialog.ShowAsync();
}

private async void PointerPressed_Event(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
{
    ContentDialog dialog = new ContentDialog
    {
        Title = "PointerPressed Event",
        Content = "PointerPressed Event succeeded!",
        PrimaryButtonText = "OK",
        XamlRoot = this.XamlRoot
    };

    await dialog.ShowAsync();
}

Workaround

None

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

"Uno.Sdk": "5.4.10"

Affected platforms

Skia

  • Desktop
  • Desktop WSL

IDE

Visual Studio 2022

IDE version

Version 17.11.4

@agneszitte agneszitte added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Oct 21, 2024
@agneszitte
Copy link
Contributor Author

agneszitte commented Oct 21, 2024

(Possible similar related issue: #14001)

fyi @dr1rrb, @ramezgerges

@ramezgerges ramezgerges self-assigned this Oct 21, 2024
@MartinZikmund MartinZikmund added project/input ⌨️ Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...) project/media 📺 Categorizes an issue or PR as relevant to media (MediaPlayer, WebView, PDF, Image, …) difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers area/skia ✏️ Categorizes an issue or PR as relevant to Skia and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers kind/bug Something isn't working project/input ⌨️ Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...) project/media 📺 Categorizes an issue or PR as relevant to media (MediaPlayer, WebView, PDF, Image, …)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants