Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Android: "Navigate back" gesture navigates back 2 times/steps #124

Description

@gentledepp

In my android app, when I use the "swipe back gesture", the app navigates back twice

I debugged it and it turns out, that on Android, when this gesture is used, Avalonia fires two events:

  • TopLevel.KeyUp (with Key.Escape)
  • TopLevel.BackRequested

so to fix this, I had to add an OperatingSystem.IsAndroid() check:

In ShellView.cs line 545:

    private async void TopLevelOnKeyUp(object? sender, KeyEventArgs e)
    {
        if (OperatingSystem.IsAndroid())
            return;

        if (e.Key == Key.Escape)
            await Back();
    }

Is this a known issue?
Happens with Avalonia 11.3.9

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions