Bug #12601
openWTableView sends "mouseDown" event with wrong Event.target property
0%
Description
Hello,
When you click on a table cell, the Wt-spacer object sends an event where #document is set as the target instead of the cell or the table itself.
Reasons not to use #document:
The #document element encompasses the entire HTML document, including the <html>, <head>, <body>, and all other elements. So, when you use #document, you get the entire document, which might lead to unexpected behavior since you may not intend to work with the entire document.
If you want to access specific parts of your document, such as a particular <div> element or an element with a specific ID, it's best to target the element directly. The #document element is too general and not specific enough for most use cases.
When someone reads or maintains your code, it's more helpful and understandable if you directly access the specific elements you're working with rather than the entire document. This increases the flexibility and maintainability of your application.
Malfunction of event-based functions, specifically in the case with the external library "Syncfusion", the component checks the last selected element in the FocusOut event. The property classList is checked for existing classes. The WT table returns #document as the target. This is only a pseudo element and does not have the property, which in turn leads to an error.
Updated by Matthias Van Ceulebroeck 4 days ago
- Status changed from New to Feedback
- Assignee set to Andreas Frolov
Hi Andreas,
it seems that I do not get this behavior? The target of the mouseDown event is always the selected cell, or that least is the case in the widget gallery example (/trees-tables/mvc-table-views).