diff --git a/ReactQt/runtime/src/rootview.cpp b/ReactQt/runtime/src/rootview.cpp index 631dfd1d8..a1ddb545a 100644 --- a/ReactQt/runtime/src/rootview.cpp +++ b/ReactQt/runtime/src/rootview.cpp @@ -53,6 +53,7 @@ class RootViewPrivate : public QObject { RootView* q_ptr; bool remoteJSDebugging = false; QNetworkReply* liveReloadUrlReply = nullptr; + QSet m_processedEvents; RootViewPrivate(RootView* q) : q_ptr(q) {} @@ -330,6 +331,12 @@ void RootView::componentComplete() { void RootView::sendMouseEvent(QMouseEvent* event, const QString& eventType, QQuickItem* receiver) { Q_D(RootView); + if (d->m_processedEvents.contains(event->timestamp())) { + return; + } else { + d->m_processedEvents.clear(); + } + QVariantMap e = makeReactTouchEvent(receiver, event); if (e.isEmpty()) return; @@ -337,6 +344,7 @@ void RootView::sendMouseEvent(QMouseEvent* event, const QString& eventType, QQui d->bridge->enqueueJSCall("RCTEventEmitter", "receiveTouches", QVariantList{normalizeInputEventName(eventType), QVariantList{e}, QVariantList{0}}); + d->m_processedEvents.insert(event->timestamp()); event->setAccepted(true); }