Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/targets/cpp/runtime/gea_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -25126,9 +25126,10 @@ bool isDocumentLevelEvent(const Node& node, const std::string& name) {
* is gated on the node's live token instead -- a rebuilt subtree leaves an
* inert closure behind rather than a second generation of the handler.
*
* Everything else is delegated to the BODY and gated by `containsNode`; see
* Bubbling events are delegated to the BODY and gated by `containsNode`; see
* the no-argument `addNodeListener` for why, and `recordNodeSubscription` for
* how it is released with the node.
* how it is released with the node. Scroll stays on its target because it does
* not bubble.
*/
template <typename Node, typename Invoke>
void bindNodeListener(Node& node, const std::string& name, Invoke invoke) {
Expand All @@ -25155,6 +25156,10 @@ void bindNodeListener(Node& node, const std::string& name, Invoke invoke) {
});
return;
}
if (name == "scroll") {
target.addEventListener(name.c_str(), std::move(run));
return;
}
const auto listenerId = gea::embedded::ui::Document::instance().body().addEventListener(
name.c_str(), [target, run](gea::framework::events::PointerEvent& event) mutable {
if (!gea::embedded::ui::Tree::instance().containsNode(target.id(), event.targetId)) return;
Expand Down
Loading