@cntrl-site/sdk-nextjs 1.9.16 → 1.9.17-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -309,11 +309,12 @@ class InteractionsRegistry {
|
|
|
309
309
|
const timestamp = Date.now();
|
|
310
310
|
for (const interaction of this.interactions) {
|
|
311
311
|
const currentStateId = this.getCurrentStateByInteractionId(interaction.id);
|
|
312
|
+
const hasInteractionScrollBasedTrigger = interaction.triggers.find((tr) => tr.type === 'item-scroll-position' || tr.type === 'scroll-position') !== undefined;
|
|
312
313
|
const matchingTrigger = interaction.triggers.find((trigger) => 'triggerEvent' in trigger
|
|
313
314
|
&& trigger.itemId === itemId
|
|
314
315
|
&& trigger.from === currentStateId
|
|
315
316
|
&& trigger.triggerEvent === triggerType);
|
|
316
|
-
if (!matchingTrigger)
|
|
317
|
+
if (!matchingTrigger || hasInteractionScrollBasedTrigger)
|
|
317
318
|
continue;
|
|
318
319
|
const activeStateId = this.getActiveInteractionState(interaction.id);
|
|
319
320
|
const isNewStateActive = matchingTrigger.to === activeStateId;
|
package/package.json
CHANGED
|
@@ -314,13 +314,14 @@ export class InteractionsRegistry implements InteractionsRegistryPort {
|
|
|
314
314
|
const timestamp = Date.now();
|
|
315
315
|
for (const interaction of this.interactions) {
|
|
316
316
|
const currentStateId = this.getCurrentStateByInteractionId(interaction.id);
|
|
317
|
+
const hasInteractionScrollBasedTrigger = interaction.triggers.find((tr) => tr.type === 'item-scroll-position' || tr.type === 'scroll-position') !== undefined;
|
|
317
318
|
const matchingTrigger = interaction.triggers.find((trigger) =>
|
|
318
319
|
'triggerEvent' in trigger
|
|
319
320
|
&& trigger.itemId === itemId
|
|
320
321
|
&& trigger.from === currentStateId
|
|
321
322
|
&& trigger.triggerEvent === triggerType
|
|
322
323
|
);
|
|
323
|
-
if (!matchingTrigger) continue;
|
|
324
|
+
if (!matchingTrigger || hasInteractionScrollBasedTrigger) continue;
|
|
324
325
|
const activeStateId = this.getActiveInteractionState(interaction.id);
|
|
325
326
|
const isNewStateActive = matchingTrigger.to === activeStateId;
|
|
326
327
|
this.setCurrentStateForInteraction(interaction.id, matchingTrigger.to);
|