Commit 6648c36a authored by WittBulter's avatar WittBulter Committed by 杨奕

Input: fix params type

parent 48135c7c
...@@ -28,8 +28,8 @@ const CONTEXT_STYLE = [ ...@@ -28,8 +28,8 @@ const CONTEXT_STYLE = [
'box-sizing' 'box-sizing'
]; ];
function calculateNodeStyling(node) { function calculateNodeStyling(targetElement) {
const style = window.getComputedStyle(node); const style = window.getComputedStyle(targetElement);
const boxSizing = style.getPropertyValue('box-sizing'); const boxSizing = style.getPropertyValue('box-sizing');
...@@ -51,7 +51,7 @@ function calculateNodeStyling(node) { ...@@ -51,7 +51,7 @@ function calculateNodeStyling(node) {
} }
export default function calcTextareaHeight( export default function calcTextareaHeight(
targetNode, targetElement,
minRows = null, minRows = null,
maxRows = null maxRows = null
) { ) {
...@@ -65,10 +65,10 @@ export default function calcTextareaHeight( ...@@ -65,10 +65,10 @@ export default function calcTextareaHeight(
borderSize, borderSize,
boxSizing, boxSizing,
contextStyle contextStyle
} = calculateNodeStyling(targetNode); } = calculateNodeStyling(targetElement);
hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`); hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
hiddenTextarea.value = targetNode.value || targetNode.placeholder || ''; hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
let height = hiddenTextarea.scrollHeight; let height = hiddenTextarea.scrollHeight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment