Skip to content

Commit

Permalink
fix(comp:textarea): measureTextarea removeChild error (#1492)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Mar 6, 2023
1 parent 1cd4dcc commit e489e8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/textarea/src/utils/measureTextarea.ts
Expand Up @@ -50,7 +50,9 @@ export function measureTextarea<V>(

textarea.parentNode!.appendChild(clonedTextarea)
const measureRes = measureFn(clonedTextarea)
textarea.parentNode!.removeChild(clonedTextarea)
if (clonedTextarea.parentNode) {
clonedTextarea.parentNode.removeChild(clonedTextarea)
}

return measureRes
}

0 comments on commit e489e8e

Please sign in to comment.