@eric-emg/symphiq-components 1.2.373 → 1.2.375

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.
@@ -88682,6 +88682,9 @@ class ShopProfileQuestionAnswerComponent {
88682
88682
  this.saveButtonsDisabled = computed(() => {
88683
88683
  return this.selectedAnswerTexts().length === 0 || this.addOtherAnswersExpanded();
88684
88684
  }, ...(ngDevMode ? [{ debugName: "saveButtonsDisabled" }] : []));
88685
+ this.stickyState = false;
88686
+ this.lastStickyChange = 0;
88687
+ this.stickyChangeCount = 0;
88685
88688
  // Initialize selected answers from existing profile answers
88686
88689
  effect(() => {
88687
88690
  const questionId = this.question().id;
@@ -88703,17 +88706,37 @@ class ShopProfileQuestionAnswerComponent {
88703
88706
  const header = this.stickyHeader?.nativeElement;
88704
88707
  const title = this.questionTitle?.nativeElement;
88705
88708
  if (!sentinel || !scrollRoot || !header) {
88709
+ console.log('[StickyDebug] Setup failed - missing elements:', { sentinel: !!sentinel, scrollRoot: !!scrollRoot, header: !!header });
88706
88710
  return;
88707
88711
  }
88712
+ console.log('[StickyDebug] Setting up IntersectionObserver');
88708
88713
  this.ngZone.runOutsideAngular(() => {
88709
88714
  this.intersectionObserver = new IntersectionObserver((entries) => {
88710
88715
  entries.forEach((entry) => {
88711
- if (!entry.isIntersecting) {
88716
+ const now = Date.now();
88717
+ const timeSinceLastChange = now - this.lastStickyChange;
88718
+ const newStickyState = !entry.isIntersecting;
88719
+ this.stickyChangeCount++;
88720
+ console.log(`[StickyDebug #${this.stickyChangeCount}] isIntersecting: ${entry.isIntersecting}, boundingClientRect.top: ${entry.boundingClientRect.top.toFixed(1)}, intersectionRatio: ${entry.intersectionRatio.toFixed(3)}, currentSticky: ${this.stickyState}, newSticky: ${newStickyState}, timeSinceLastChange: ${timeSinceLastChange}ms`);
88721
+ // Debounce: ignore changes within 250ms (longer than the 200ms CSS transition) to prevent flip-flopping
88722
+ if (timeSinceLastChange < 250 && this.stickyState !== newStickyState) {
88723
+ console.log(`[StickyDebug] DEBOUNCED - ignoring change from ${this.stickyState} to ${newStickyState} (only ${timeSinceLastChange}ms since last change)`);
88724
+ return;
88725
+ }
88726
+ if (this.stickyState === newStickyState) {
88727
+ console.log(`[StickyDebug] No state change needed (already ${this.stickyState})`);
88728
+ return;
88729
+ }
88730
+ this.stickyState = newStickyState;
88731
+ this.lastStickyChange = now;
88732
+ if (newStickyState) {
88733
+ console.log('[StickyDebug] Applying sticky classes');
88712
88734
  header.classList.add('shadow-md');
88713
88735
  header.classList.add('is-sticky');
88714
88736
  title?.classList.add('is-sticky');
88715
88737
  }
88716
88738
  else {
88739
+ console.log('[StickyDebug] Removing sticky classes');
88717
88740
  header.classList.remove('shadow-md');
88718
88741
  header.classList.remove('is-sticky');
88719
88742
  title?.classList.remove('is-sticky');
@@ -88721,7 +88744,8 @@ class ShopProfileQuestionAnswerComponent {
88721
88744
  });
88722
88745
  }, {
88723
88746
  root: scrollRoot,
88724
- threshold: 0
88747
+ threshold: 0,
88748
+ rootMargin: '-20px 0px 0px 0px'
88725
88749
  });
88726
88750
  this.intersectionObserver.observe(sentinel);
88727
88751
  });