bhl-forms 0.0.45 → 0.0.46

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.
@@ -17993,16 +17993,26 @@ function prepData(formData) {
17993
17993
  };
17994
17994
  return data2;
17995
17995
  }
17996
- var isMobile = window.matchMedia("only screen and (max-width: 480px)").matches;
17996
+ window.matchMedia("only screen and (max-width: 480px)").matches;
17997
+ function getCoords(elem) {
17998
+ var box2 = elem.getBoundingClientRect();
17999
+ return {
18000
+ top: box2.top + window.pageYOffset,
18001
+ right: box2.right + window.pageXOffset,
18002
+ bottom: box2.bottom + window.pageYOffset,
18003
+ left: box2.left + window.pageXOffset
18004
+ };
18005
+ }
17997
18006
  var fireStepEvent = (formNode) => (stepResult, stepHistory2, stepQueue2) => {
17998
18007
  if (!stepResult) {
17999
18008
  return;
18000
18009
  }
18001
18010
  var anchorId = formNode.attrs.anchorElement || formNode.id;
18002
- if (anchorId && isMobile) {
18011
+ if (anchorId) {
18003
18012
  var anchor = document.getElementById(anchorId);
18004
18013
  if (anchor) {
18005
- anchor.scrollIntoView(true);
18014
+ var pos = getCoords(anchor);
18015
+ window.scrollTo(pos.right, pos.top);
18006
18016
  }
18007
18017
  }
18008
18018
  var step_values = null;