(input)
| 2796 | element.parentNode.replaceChild(newElement, element); |
| 2797 | // Immediately restore the value and ensure option exists |
| 2798 | if (currentValue) { |
| 2799 | // Check if option exists |
| 2800 | const optionExists = Array.from(newElement.options).some(opt => opt.value === currentValue); |
| 2801 | if (!optionExists) { |
| 2802 | const option = document.createElement('option'); |
| 2803 | option.value = currentValue; |
| 2804 | option.textContent = currentValue; |
| 2805 | newElement.appendChild(option); |
| 2806 | } |
| 2807 | newElement.value = currentValue; |
| 2808 | console.log('Designer value after clone:', newElement.value); |
| 2809 | } |
| 2810 | } else { |
no outgoing calls
no test coverage detected