From ad487f4585fe48fa33884609e81359c0100268ba Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Fri, 11 Aug 2017 20:40:37 +0800 Subject: [PATCH] Set overflow hidden for input elements --- src/NodeContainer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NodeContainer.js b/src/NodeContainer.js index 9769dbd..07a48d5 100644 --- a/src/NodeContainer.js +++ b/src/NodeContainer.js @@ -72,6 +72,8 @@ type StyleDeclaration = { zIndex: zIndex }; +const INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT']; + export default class NodeContainer { name: ?string; parent: ?NodeContainer; @@ -114,7 +116,10 @@ export default class NodeContainer { font: parseFont(style), letterSpacing: parseLetterSpacing(style.letterSpacing), opacity: parseFloat(style.opacity), - overflow: parseOverflow(style.overflow), + overflow: + INPUT_TAGS.indexOf(node.tagName) === -1 + ? parseOverflow(style.overflow) + : OVERFLOW.HIDDEN, padding: parsePadding(style), position: position, textDecoration: parseTextDecoration(style),