(nativeNode: T, clonedNode: T)
| 174 | } |
| 175 | |
| 176 | function cloneSelectValue<T extends HTMLElement>(nativeNode: T, clonedNode: T) { |
| 177 | if (isInstanceOfElement(nativeNode, HTMLSelectElement)) { |
| 178 | const clonedSelect = clonedNode as any as HTMLSelectElement |
| 179 | const selectedOption = Array.from(clonedSelect.children).find( |
| 180 | (child) => nativeNode.value === child.getAttribute('value'), |
| 181 | ) |
| 182 | |
| 183 | if (selectedOption) { |
| 184 | selectedOption.setAttribute('selected', '') |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | function decorate<T extends HTMLElement>( |
| 190 | nativeNode: T, |
no test coverage detected
searching dependent graphs…