@eric-emg/symphiq-components 1.2.375 → 1.2.376

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.
@@ -88683,8 +88683,6 @@ class ShopProfileQuestionAnswerComponent {
88683
88683
  return this.selectedAnswerTexts().length === 0 || this.addOtherAnswersExpanded();
88684
88684
  }, ...(ngDevMode ? [{ debugName: "saveButtonsDisabled" }] : []));
88685
88685
  this.stickyState = false;
88686
- this.lastStickyChange = 0;
88687
- this.stickyChangeCount = 0;
88688
88686
  // Initialize selected answers from existing profile answers
88689
88687
  effect(() => {
88690
88688
  const questionId = this.question().id;
@@ -88706,47 +88704,35 @@ class ShopProfileQuestionAnswerComponent {
88706
88704
  const header = this.stickyHeader?.nativeElement;
88707
88705
  const title = this.questionTitle?.nativeElement;
88708
88706
  if (!sentinel || !scrollRoot || !header) {
88709
- console.log('[StickyDebug] Setup failed - missing elements:', { sentinel: !!sentinel, scrollRoot: !!scrollRoot, header: !!header });
88710
88707
  return;
88711
88708
  }
88712
- console.log('[StickyDebug] Setting up IntersectionObserver');
88713
88709
  this.ngZone.runOutsideAngular(() => {
88714
88710
  this.intersectionObserver = new IntersectionObserver((entries) => {
88715
88711
  entries.forEach((entry) => {
88716
- const now = Date.now();
88717
- const timeSinceLastChange = now - this.lastStickyChange;
88718
88712
  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
88713
  if (this.stickyState === newStickyState) {
88727
- console.log(`[StickyDebug] No state change needed (already ${this.stickyState})`);
88728
88714
  return;
88729
88715
  }
88730
88716
  this.stickyState = newStickyState;
88731
- this.lastStickyChange = now;
88732
88717
  if (newStickyState) {
88733
- console.log('[StickyDebug] Applying sticky classes');
88734
- header.classList.add('shadow-md');
88735
- header.classList.add('is-sticky');
88718
+ // Lock header height BEFORE applying sticky to prevent layout shift
88719
+ const currentHeight = header.offsetHeight;
88720
+ header.style.minHeight = `${currentHeight}px`;
88721
+ header.classList.add('shadow-md', 'is-sticky');
88736
88722
  title?.classList.add('is-sticky');
88737
88723
  }
88738
88724
  else {
88739
- console.log('[StickyDebug] Removing sticky classes');
88740
- header.classList.remove('shadow-md');
88741
- header.classList.remove('is-sticky');
88725
+ header.classList.remove('shadow-md', 'is-sticky');
88742
88726
  title?.classList.remove('is-sticky');
88727
+ // Release height lock after transition completes
88728
+ setTimeout(() => {
88729
+ if (!this.stickyState) {
88730
+ header.style.minHeight = '';
88731
+ }
88732
+ }, 200);
88743
88733
  }
88744
88734
  });
88745
- }, {
88746
- root: scrollRoot,
88747
- threshold: 0,
88748
- rootMargin: '-20px 0px 0px 0px'
88749
- });
88735
+ }, { root: scrollRoot, threshold: 0 });
88750
88736
  this.intersectionObserver.observe(sentinel);
88751
88737
  });
88752
88738
  }