lisichatbot 1.6.2 → 1.6.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +35 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -2118,6 +2118,12 @@ async function handleNext() {
2118
2118
  chatState.currentSelection = null;
2119
2119
  disableNextButton();
2120
2120
  await showNextStep();
2121
+
2122
+ // ✅ NEW: Extra scroll after jump to ensure inputs are visible
2123
+ setTimeout(() => {
2124
+ scrollToBottom();
2125
+ }, 350);
2126
+
2121
2127
  return;
2122
2128
  } else {
2123
2129
  console.error(`❌ No step found with name: "${stepName}"`);
@@ -2150,6 +2156,12 @@ async function handleNext() {
2150
2156
  chatState.currentSelection = null;
2151
2157
  disableNextButton();
2152
2158
  await showNextStep();
2159
+
2160
+ // ✅ NEW: Extra scroll after jump to ensure inputs are visible
2161
+ setTimeout(() => {
2162
+ scrollToBottom();
2163
+ }, 350);
2164
+
2153
2165
  return;
2154
2166
  } else {
2155
2167
  console.error(`Invalid step number: ${targetStep}`);
@@ -2373,6 +2385,12 @@ async function handleNext() {
2373
2385
  }
2374
2386
 
2375
2387
  await showNextStep();
2388
+
2389
+ // ✅ NEW: Extra scroll after step is shown to ensure visibility
2390
+ // This catches cases where showMessage was called in onNext before progressing
2391
+ setTimeout(() => {
2392
+ scrollToBottom();
2393
+ }, 350);
2376
2394
  }
2377
2395
 
2378
2396
  // ✅ NEW: Helper function to find next step that is accessible in normal flow
@@ -2636,6 +2654,12 @@ async function showNextStep() {
2636
2654
  chatState.currentSelection = null;
2637
2655
  disableNextButton();
2638
2656
  await showNextStep();
2657
+
2658
+ // ✅ NEW: Extra scroll after jump to ensure inputs are visible
2659
+ setTimeout(() => {
2660
+ scrollToBottom();
2661
+ }, 350);
2662
+
2639
2663
  return;
2640
2664
  } else {
2641
2665
  console.error(`❌ No step found with name: "${stepName}"`);
@@ -2668,6 +2692,12 @@ async function showNextStep() {
2668
2692
  chatState.currentSelection = null;
2669
2693
  disableNextButton();
2670
2694
  await showNextStep();
2695
+
2696
+ // ✅ NEW: Extra scroll after jump to ensure inputs are visible
2697
+ setTimeout(() => {
2698
+ scrollToBottom();
2699
+ }, 350);
2700
+
2671
2701
  return;
2672
2702
  } else {
2673
2703
  console.error(`Invalid step number: ${targetStep}`);
@@ -2890,6 +2920,11 @@ async function showNextStep() {
2890
2920
  setTimeout(() => {
2891
2921
  scrollToBottom();
2892
2922
  }, 150);
2923
+
2924
+ // ✅ NEW: Extra delayed scroll to catch cases where showMessage was called before this step
2925
+ setTimeout(() => {
2926
+ scrollToBottom();
2927
+ }, 300);
2893
2928
  }
2894
2929
 
2895
2930
  function handleCompletion() {