mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 08:18:55 +00:00
LibWeb: Look for labeled control in DOM tree instead of layout tree
...because "change" event should be dispatched on control even if it has "display: none" style. This change fixes selection in labels dropdown on GitHub's "new issue" page.
This commit is contained in:
parent
730876fda9
commit
f932d5d825
Notes:
sideshowbarker
2024-07-17 07:11:12 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: f932d5d825
Pull-request: https://github.com/SerenityOS/serenity/pull/23684
8 changed files with 74 additions and 49 deletions
|
@ -30,10 +30,8 @@ bool TextPaintable::wants_mouse_events() const
|
|||
|
||||
DOM::Node* TextPaintable::mouse_event_target() const
|
||||
{
|
||||
if (auto* label = layout_node().first_ancestor_of_type<Layout::Label>()) {
|
||||
if (auto* control = const_cast<Layout::Label*>(label)->labeled_control())
|
||||
return &control->dom_node();
|
||||
}
|
||||
if (auto const* label = layout_node().first_ancestor_of_type<Layout::Label>())
|
||||
return label->dom_node().control().ptr();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue