Skip to content

Image viewer: capture Escape only when the view changed; cover the hover and pan-only cases #52

Closed

Description

@hkngln

Follow-up from the #51 review.

The viewer currently captures Escape when it is hovered OR its state is not the default. A hovered, untouched viewer still swallows Escape even though there is nothing to reset: for example, a modal that closes on Escape release stays open while the cursor is over an image inside it. Capturing only when the state is not the default would interfere less.

The tests in widget/tests/image_viewer.rs also leave two cases uncovered:

  • the hover clause (viewer.rs:166-167);
  • the offset part of is_default (viewer.rs:171), i.e. a pan-only state.

Mutation-check both new tests.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added a commit that references this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions