@klippa/ngx-enhancy-forms 14.22.7 → 14.22.8
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.
- package/esm2020/lib/form/form-element/form-element.component.mjs +8 -12
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +7 -11
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +7 -11
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/form/form-element/form-element.component.d.ts +0 -1
- package/package.json +1 -1
|
@@ -679,20 +679,16 @@ class FormElementComponent {
|
|
|
679
679
|
return this.getScrollableParent(node.parentNode);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
getPageOffset(elem) {
|
|
683
|
-
let topOffset = elem.getBoundingClientRect().top;
|
|
684
|
-
while (elem !== document.documentElement) {
|
|
685
|
-
elem = elem.parentElement;
|
|
686
|
-
topOffset += elem.scrollTop;
|
|
687
|
-
}
|
|
688
|
-
return topOffset;
|
|
689
|
-
}
|
|
690
682
|
scrollTo() {
|
|
691
683
|
const parent = this.getScrollableParent(this.internalComponentRef.nativeElement);
|
|
692
|
-
const
|
|
693
|
-
const
|
|
684
|
+
const parentTop = parent === window.document.documentElement ? 0 : parent.getBoundingClientRect().top;
|
|
685
|
+
const elementTop = this.internalComponentRef.nativeElement.getBoundingClientRect().top;
|
|
686
|
+
const parentScrollTop = parent.scrollTop;
|
|
687
|
+
const answer = elementTop - parentTop + parentScrollTop;
|
|
688
|
+
console.log('answer', parentTop, elementTop, parentScrollTop, answer);
|
|
689
|
+
console.log(parent, this.internalComponentRef.nativeElement);
|
|
694
690
|
parent.scrollTo({
|
|
695
|
-
top:
|
|
691
|
+
top: answer - 30,
|
|
696
692
|
behavior: 'smooth'
|
|
697
693
|
});
|
|
698
694
|
}
|