Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Dec 19, 2024
1 parent fa5802d commit 2161e7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ void ScrollViewEventEmitter::onScrollBeginDrag(
}

void ScrollViewEventEmitter::onScrollEndDrag(
const ScrollEndDragEvent& scrollEvent) const {
dispatchEvent(
"scrollEndDrag", std::make_shared<ScrollEndDragEvent>(scrollEvent));
const ScrollEvent& scrollEvent) const {
const auto* endDragScrollEvent =
dynamic_cast<const ScrollEndDragEvent*>(&scrollEvent);
if (endDragScrollEvent) {
dispatchEvent(
"scrollEndDrag",
std::make_shared<ScrollEndDragEvent>(*endDragScrollEvent));
} else {
dispatchScrollViewEvent("scrollEndDrag", scrollEvent);
}
}

void ScrollViewEventEmitter::onMomentumScrollBegin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ScrollViewEventEmitter : public ViewEventEmitter {

void onScroll(const ScrollEvent& scrollEvent) const;
void onScrollBeginDrag(const ScrollEvent& scrollEvent) const;
void onScrollEndDrag(const ScrollEndDragEvent& scrollEvent) const;
void onScrollEndDrag(const ScrollEvent& scrollEvent) const;
void onMomentumScrollBegin(const ScrollEvent& scrollEvent) const;
void onMomentumScrollEnd(const ScrollEvent& scrollEvent) const;
void onScrollToTop(const ScrollEvent& scrollEvent) const;
Expand Down

0 comments on commit 2161e7e

Please sign in to comment.