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}