From e14656a0882007698fae92e5b547af1e4436f6e2 Mon Sep 17 00:00:00 2001 From: MoyuScript Date: Thu, 10 Aug 2017 21:58:36 +0800 Subject: [PATCH] Fix incorrect render order in Firefox for position: static an z-index value --- src/NodeContainer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NodeContainer.js b/src/NodeContainer.js index 3e438d6..5fd6a78 100644 --- a/src/NodeContainer.js +++ b/src/NodeContainer.js @@ -97,6 +97,8 @@ export default class NodeContainer { const IS_INPUT = node.type === 'radio' || node.type === 'checkbox'; + const position = parsePosition(style.position); + this.style = { background: IS_INPUT ? INPUT_BACKGROUND : parseBackground(style, imageLoader), border: IS_INPUT ? INPUT_BORDERS : parseBorder(style), @@ -114,13 +116,13 @@ export default class NodeContainer { opacity: parseFloat(style.opacity), overflow: parseOverflow(style.overflow), padding: parsePadding(style), - position: parsePosition(style.position), + position: position, textDecoration: parseTextDecoration(style), textShadow: parseTextShadow(style.textShadow), textTransform: parseTextTransform(style.textTransform), transform: parseTransform(style), visibility: parseVisibility(style.visibility), - zIndex: parseZIndex(style.zIndex) + zIndex: position !== POSITION.STATIC ? parseZIndex(style.zIndex) : 0 }; if (this.isTransformed()) {