mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
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:
@@ -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 } =
|
||||
|
||||
Reference in New Issue
Block a user