HtmlViewer icon indicating copy to clipboard operation
HtmlViewer copied to clipboard

SetFocus in THtmlViewer.HTMLMouseDown Can Break HTML Forms

Open jokershigh opened this issue 8 months ago • 0 comments

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

jokershigh avatar May 01 '25 02:05 jokershigh