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

WebPreview: Refactor into a functional component with hooks #4372

Open

Description

@thomasguillot

Conceptually unrelated to this PR, but this WebPreview class component could be a good candidate for refactoring into a functional component with hooks in a future PR, which would simplify lifecycle management (e.g., using useEffect for event listeners instead of componentDidUpdate/componentWillUnmount).

Escape-to-close doesn't fire once focus is inside the iframe, where users typically interact during preview. Keydown events on the parent document are not received by the iframe. Consider wiring a keydown handler to the iframe's contentWindow on load (guarded for same-origin).

See details

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions