fix(components): [textarea] unexpected page scrolling when typing in Firefox (#23606)

* fix(components): [textarea] unexpected page scrolling when typing in Firefox

* docs: add issue number
This commit is contained in:
rzzf
2026-02-11 06:50:00 +08:00
committed by GitHub
parent a005d766e6
commit efc729e3e0

View File

@@ -76,7 +76,12 @@ export function calcTextareaHeight(
): TextAreaHeight {
if (!hiddenTextarea) {
hiddenTextarea = document.createElement('textarea')
;(targetElement.parentNode ?? document.body).appendChild(hiddenTextarea)
let hostNode = document.body
// #23575
if (!isFirefox() && targetElement.parentNode) {
hostNode = targetElement.parentNode as HTMLElement
}
hostNode.appendChild(hiddenTextarea)
}
const { paddingSize, borderSize, boxSizing, contextStyle } =