bhl-forms 0.0.51 → 0.0.52

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.
@@ -5769,14 +5769,14 @@ function useSteps() {
5769
5769
  if (autoFocus) {
5770
5770
  const newNode = steps2[activeStep2.value].node;
5771
5771
  const firstInput = findFirstInput(newNode);
5772
- if (!firstInput) {
5773
- return;
5774
- }
5775
- if (autoFocusTypes.indexOf(firstInput.context.type) === -1) {
5776
- return;
5772
+ if (firstInput && autoFocusTypes.indexOf(firstInput.context.type) > -1) {
5773
+ const elem = document.getElementById(firstInput.context.id);
5774
+ try {
5775
+ focusAndOpenKeyboard(elem);
5776
+ } catch (e) {
5777
+ console.warn("Failed to autoFocus:", e);
5778
+ }
5777
5779
  }
5778
- const elem = document.getElementById(firstInput.context.id);
5779
- focusAndOpenKeyboard(elem);
5780
5780
  }
5781
5781
  return true;
5782
5782
  };
@@ -11100,6 +11100,7 @@ const scrollAnchor = (formNode) => () => {
11100
11100
  const anchor = document.getElementById(anchorId);
11101
11101
  if (anchor) {
11102
11102
  const pos = getCoords(anchor);
11103
+ dbg("scrollTo", pos);
11103
11104
  window.scrollTo(pos.right, pos.top);
11104
11105
  }
11105
11106
  }