From a176a7fd246c6d0db25c2a6a4d417d811aeee71e Mon Sep 17 00:00:00 2001 From: "Y.Petremann" Date: Thu, 23 Jan 2025 06:02:21 +0100 Subject: [PATCH] Update styles.ts: add support to top,left,bottom and right This add support for absolute positionning with top,left,bottom and right --- src/styles.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/styles.ts b/src/styles.ts index f10ed4c0..0ef0ddba 100644 --- a/src/styles.ts +++ b/src/styles.ts @@ -312,6 +312,18 @@ const applyPositionStyles = (node: YogaNode, style: Styles): void => { : Yoga.POSITION_TYPE_RELATIVE, ); } + if ('top' in style) { + node.setPosition(Yoga.EDGE_TOP, style.top ?? 0); + } + if ('left' in style) { + node.setPosition(Yoga.EDGE_LEFT, style.left ?? 0); + } + if ('bottom' in style) { + node.setPosition(Yoga.EDGE_BOTTOM, style.bottom ?? 0); + } + if ('right' in style) { + node.setPosition(Yoga.EDGE_RIGHT, style.right ?? 0); + } }; const applyMarginStyles = (node: YogaNode, style: Styles): void => {