Skip to content

WebPreview: Refactor into a functional component with hooks #4372

@thomasguillot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions