lisichatbot 1.3.3 → 1.3.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.
- package/package.json +1 -1
- package/src/index.js +9 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1373,14 +1373,19 @@ async function handleNext() {
|
|
|
1373
1373
|
console.log(`Field: ${field}`);
|
|
1374
1374
|
console.log(`Custom config:`, customConfig);
|
|
1375
1375
|
|
|
1376
|
-
// Check if
|
|
1376
|
+
// Check if the CUSTOM OPTION is actually selected (not just if value is array)
|
|
1377
|
+
// Regular options can also have array values!
|
|
1378
|
+
const customOptionElement = document.querySelector(
|
|
1379
|
+
`[data-field="${field}"][data-is-custom="true"][data-chat-element="single-select-input"]`
|
|
1380
|
+
);
|
|
1381
|
+
const isCustomOptionSelected = customOptionElement?.classList.contains('cf-checked');
|
|
1382
|
+
|
|
1377
1383
|
const selectedValue = chatState.data[field];
|
|
1378
|
-
const isCustomRange = Array.isArray(selectedValue);
|
|
1379
1384
|
|
|
1380
1385
|
console.log(`Selected value:`, selectedValue);
|
|
1381
|
-
console.log(`Is custom
|
|
1386
|
+
console.log(`Is custom option selected? ${isCustomOptionSelected}`);
|
|
1382
1387
|
|
|
1383
|
-
if (
|
|
1388
|
+
if (isCustomOptionSelected && customConfig) {
|
|
1384
1389
|
// Validate the custom range one more time before proceeding
|
|
1385
1390
|
console.log(`🔄 Running final validation before proceeding...`);
|
|
1386
1391
|
|