Skip to content

SetFocus in THtmlViewer.HTMLMouseDown Can Break HTML Forms #358

@jokershigh

Description

@jokershigh

When clicking anywhere inside the THtmlViewer component (specifically on elements that aren't interactive links or controls handled differently), the THtmlViewer.HTMLMouseDown event handler is triggered. This handler unconditionally calls SetFocus;, causing the THtmlViewer's PaintPanel or the viewer itself to receive the input focus from the operating system.
While setting focus might be intended behavior in some scenarios (e.g., preparing for keyboard navigation within the viewer), it can cause significant problems with HTML forms, making them stop working.

Workaround: comment SetFocus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions