From f0671edfe9771753ce003ec671989f65e3d9d9f0 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 31 Mar 2026 16:07:23 -0500 Subject: [PATCH] Couple cleanups --- .../Messages/components/MessageComposer.tsx | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/screens/Messages/components/MessageComposer.tsx b/src/screens/Messages/components/MessageComposer.tsx index 8aca011ece..6db22c4522 100644 --- a/src/screens/Messages/components/MessageComposer.tsx +++ b/src/screens/Messages/components/MessageComposer.tsx @@ -1,12 +1,3 @@ -/** - * All - * - look at Text as children option to preserve lineHeight - * - * Native - * - * Web - */ - import { useCallback, useEffect, @@ -255,14 +246,17 @@ function Composer({ height: (textStyle.lineHeight || 20) + p.paddingTop + p.paddingBottom, } : {minHeight, maxHeight} + /* * On iOS especially, TextInput and Text line height does not render the * same way, but setting this to undefined and using the default font * metrics works fine. */ if (!IS_WEB) { - delete textStyle.lineHeight + // disabled for now to eval the text as children + // delete textStyle.lineHeight } + return { textStyle, textAreaStyle, @@ -354,45 +348,50 @@ function Composer({ [onRequestSubmit], ) + const textContent = ( + + {tapper.state.nodes.map((node, i) => { + switch (node.type) { + case 'text': { + return {node.value} + } + case 'trigger': + case 'facet': { + return ( + + {node.raw} + + ) + } + } + })} + + ) + return ( <> - {/* PREVIEW */} - - - - {tapper.state.nodes.map((node, i) => { - switch (node.type) { - case 'text': { - return {node.value} - } - case 'trigger': - case 'facet': { - return ( - - {node.raw} - - ) - } - } - })} - - - + {IS_WEB && ( + + + {textContent} + + + )} { if (IS_WEB) { - // TODO why does compiler not like this? scrollY.value = (e.target as any).scrollTop } else { scrollY.value = e.nativeEvent.contentOffset.y @@ -461,8 +460,9 @@ function Composer({ // @ts-ignore web only onCompositionEnd={() => { isComposing.current = false - }} - /> + }}> + {IS_WEB ? null : textContent} + {children}