lisichatbot 1.7.1 → 1.7.3

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 +77 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -1111,7 +1111,21 @@ function renderMinMaxInputs(field, customConfig, existingData) {
1111
1111
  rangeWrapper.appendChild(errorDiv);
1112
1112
 
1113
1113
  elements.messages.appendChild(rangeWrapper);
1114
- scrollToBottom(); // ✅ Scroll after adding range inputs
1114
+
1115
+ // ✅ Multiple scrolls to ensure range inputs are visible
1116
+ scrollToBottom(); // Immediate
1117
+
1118
+ setTimeout(() => {
1119
+ scrollToBottom();
1120
+ }, 50);
1121
+
1122
+ setTimeout(() => {
1123
+ scrollToBottom();
1124
+ }, 150);
1125
+
1126
+ setTimeout(() => {
1127
+ scrollToBottom();
1128
+ }, 300);
1115
1129
 
1116
1130
  if (minInput && maxInput) {
1117
1131
  const updateVisualFeedback = () => {
@@ -1181,10 +1195,21 @@ function selectCustomOption(field) {
1181
1195
  const rangeWrapper = document.querySelector(`[data-chat-element="range-wrapper"][data-field="${field}"]`);
1182
1196
  if (rangeWrapper) {
1183
1197
  rangeWrapper.style.display = 'flex';
1184
- // ✅ Scroll after showing range inputs
1198
+
1199
+ // ✅ Multiple scrolls to ensure range inputs are visible
1200
+ scrollToBottom();
1201
+
1185
1202
  setTimeout(() => {
1186
1203
  scrollToBottom();
1187
- }, 100);
1204
+ }, 50);
1205
+
1206
+ setTimeout(() => {
1207
+ scrollToBottom();
1208
+ }, 150);
1209
+
1210
+ setTimeout(() => {
1211
+ scrollToBottom();
1212
+ }, 300);
1188
1213
  }
1189
1214
  }
1190
1215
 
@@ -1258,6 +1283,29 @@ function handleCustomSelectClick(element, field, customConfig) {
1258
1283
 
1259
1284
  if (rangeWrapper) {
1260
1285
  rangeWrapper.style.display = 'flex';
1286
+
1287
+ // ✅ Aggressive scrolling to show range inputs
1288
+ console.log(' 📜 Custom selected - scrolling to show range inputs');
1289
+
1290
+ // Immediate scroll
1291
+ scrollToBottom();
1292
+
1293
+ // Multiple delayed scrolls to ensure visibility
1294
+ setTimeout(() => {
1295
+ scrollToBottom();
1296
+ }, 50);
1297
+
1298
+ setTimeout(() => {
1299
+ scrollToBottom();
1300
+ }, 150);
1301
+
1302
+ setTimeout(() => {
1303
+ scrollToBottom();
1304
+ }, 300);
1305
+
1306
+ setTimeout(() => {
1307
+ scrollToBottom();
1308
+ }, 500);
1261
1309
  }
1262
1310
 
1263
1311
  chatState.currentSelection = null;
@@ -2892,6 +2940,19 @@ async function showNextStep() {
2892
2940
  nextStep.input.custom
2893
2941
  );
2894
2942
 
2943
+ // ✅ Delayed scrolls to ensure all options are visible
2944
+ setTimeout(() => {
2945
+ scrollToBottom();
2946
+ }, 100);
2947
+
2948
+ setTimeout(() => {
2949
+ scrollToBottom();
2950
+ }, 250);
2951
+
2952
+ setTimeout(() => {
2953
+ scrollToBottom();
2954
+ }, 400);
2955
+
2895
2956
  // ✅ Check if pre-filled - renderCustomSelectOptions handles enabling if pre-filled
2896
2957
  const existingData = chatState.data[nextStep.input.field];
2897
2958
  const hasPreFill = existingData !== undefined && existingData !== null;
@@ -3037,6 +3098,19 @@ function handleCompletion() {
3037
3098
  });
3038
3099
  console.log(' 🙈 Hidden all range-wrappers on completion');
3039
3100
 
3101
+ // ✅ Hide all text and number inputs
3102
+ const allTextInputs = document.querySelectorAll('[data-chat-element="text-input"]');
3103
+ allTextInputs.forEach(input => {
3104
+ input.style.display = 'none';
3105
+ });
3106
+ console.log(' 🙈 Hidden all text-inputs on completion');
3107
+
3108
+ const allNumberInputs = document.querySelectorAll('[data-chat-element="number-input"]');
3109
+ allNumberInputs.forEach(input => {
3110
+ input.style.display = 'none';
3111
+ });
3112
+ console.log(' 🙈 Hidden all number-inputs on completion');
3113
+
3040
3114
  updateEditIcons();
3041
3115
 
3042
3116
  if (elements.nextBtn) {