(element)
| 75 | * Get element value handling different input types |
| 76 | */ |
| 77 | export function getElementValue(element) { |
| 78 | if (!element) return ''; |
| 79 | |
| 80 | const tagName = element.tagName.toLowerCase(); |
| 81 | |
| 82 | if (tagName === 'input' || tagName === 'textarea') { |
| 83 | return element.value; |
| 84 | } else if (tagName === 'select') { |
| 85 | const selectedOption = element.options[element.selectedIndex]; |
| 86 | return { |
| 87 | value: element.value, |
| 88 | text: selectedOption ? selectedOption.text : '', |
| 89 | selectedIndex: element.selectedIndex |
| 90 | }; |
| 91 | } else if (element.isContentEditable) { |
| 92 | return element.textContent; |
| 93 | } else { |
| 94 | return element.textContent.trim(); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Check if element is interactive (clickable, editable, etc.) |
nothing calls this directly
no outgoing calls
no test coverage detected