lisichatbot 2.0.6 → 2.0.7
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 +8 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -912,8 +912,16 @@ function renderCustomSelectOptions(options, field, customConfig) {
|
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
914
|
|
|
915
|
+
// ✅ NEW: Remove any existing options-wrapper for this field
|
|
916
|
+
const existingWrapper = elements.messages.querySelector(`[data-chat-element="options-wrapper"][data-field="${field}"]`);
|
|
917
|
+
if (existingWrapper) {
|
|
918
|
+
existingWrapper.remove();
|
|
919
|
+
console.log(` 🗑️ Removed existing options-wrapper for field: ${field}`);
|
|
920
|
+
}
|
|
921
|
+
|
|
915
922
|
const optionsWrapper = document.createElement('div');
|
|
916
923
|
optionsWrapper.setAttribute('data-chat-element', 'options-wrapper');
|
|
924
|
+
optionsWrapper.setAttribute('data-field', field); // ✅ Add field attribute for identification
|
|
917
925
|
optionsWrapper.style.display = 'flex';
|
|
918
926
|
optionsWrapper.style.flexDirection = 'row';
|
|
919
927
|
optionsWrapper.style.flexWrap = 'wrap';
|