Fix it, android position is still off

This commit is contained in:
Eric Bailey
2026-04-06 07:13:26 -05:00
parent 274eec8cc2
commit e2c1fec85f
3 changed files with 53 additions and 51 deletions
+2 -2
View File
@@ -88,8 +88,8 @@
"@bsky.app/expo-image-crop-tool": "^0.5.0", "@bsky.app/expo-image-crop-tool": "^0.5.0",
"@bsky.app/expo-translate-text": "^0.2.9", "@bsky.app/expo-translate-text": "^0.2.9",
"@bsky.app/react-native-mmkv": "2.12.5", "@bsky.app/react-native-mmkv": "2.12.5",
"@bsky.app/sift": "^0.2.9", "@bsky.app/sift": "^0.2.11",
"@bsky.app/tapper": "^0.4.2", "@bsky.app/tapper": "^0.4.3",
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet", "@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
"@emoji-mart/data": "^1.2.1", "@emoji-mart/data": "^1.2.1",
"@emoji-mart/react": "^1.1.1", "@emoji-mart/react": "^1.1.1",
+43 -41
View File
@@ -150,6 +150,7 @@ export function Composer({
placement: autocompletePlacement, placement: autocompletePlacement,
dynamicWidth: IS_WEB, dynamicWidth: IS_WEB,
insets, insets,
anchorRef: autocompleteAnchorRef,
}) })
/* /*
@@ -178,12 +179,6 @@ export function Composer({
[tapper.input, tapper.insert, inputScrollSharedValue], [tapper.input, tapper.insert, inputScrollSharedValue],
) )
useEffect(() => {
if (autocompleteAnchorRef) {
sift.refs.setAnchor(autocompleteAnchorRef.current)
}
}, [sift.refs])
/* /*
* Skip the initial mount to avoid an unnecessary re-render — the parent * Skip the initial mount to avoid an unnecessary re-render — the parent
* already knows the initial value since it passed `initialText`. * already knows the initial value since it passed `initialText`.
@@ -294,42 +289,48 @@ export function Composer({
useOnKeyboard('keyboardDidShow', updateAutocompletePosition) useOnKeyboard('keyboardDidShow', updateAutocompletePosition)
useOnKeyboard('keyboardDidHide', updateAutocompletePosition) useOnKeyboard('keyboardDidHide', updateAutocompletePosition)
const textContent = (
<Text style={[textStyle, web({whiteSpace: 'pre-wrap'})]}>
{tapper.state.nodes.map((node, i) => {
switch (node.type) {
case 'text':
return <Span key={i}>{node.value}</Span>
case 'trigger':
case 'facet':
return (
<Span
key={i}
ref={IS_WEB ? sift.refs.setAnchor : undefined}
style={
node.type === 'facet' && {
color: t.palette.primary_500,
}
}>
{node.raw}
</Span>
)
}
})}
</Text>
)
return ( return (
<> <>
<View style={[a.relative, outerStyle]}> <View style={[a.relative, outerStyle]}>
<View {IS_WEB && (
pointerEvents="none" <View
style={[a.absolute, a.inset_0, a.z_10, {overflow: 'hidden'}]}> pointerEvents="none"
<Animated.View style={[a.absolute, a.inset_0, a.z_10, {overflow: 'hidden'}]}>
style={[ <Animated.View
contentPaddingStyle, style={[
{position: 'absolute', left: 0, right: 0}, contentPaddingStyle,
previewScrollStyle, {position: 'absolute', left: 0, right: 0},
]}> previewScrollStyle,
<Text style={[textStyle, web({whiteSpace: 'pre-wrap'})]}> ]}>
{tapper.state.nodes.map((node, i) => { {textContent}
switch (node.type) { </Animated.View>
case 'text': </View>
return <Span key={i}>{node.value}</Span> )}
case 'trigger':
case 'facet':
return (
<Span
key={i}
ref={IS_WEB ? sift.refs.setAnchor : undefined}
style={
node.type === 'facet' && {
color: t.palette.primary_500,
}
}>
{node.raw}
</Span>
)
}
})}
</Text>
</Animated.View>
</View>
<AutosizedTextarea <AutosizedTextarea
placeholderTextColor={t.palette.contrast_500} placeholderTextColor={t.palette.contrast_500}
accessibilityLabel={label} accessibilityLabel={label}
@@ -374,8 +375,9 @@ export function Composer({
onCompositionEnd={() => { onCompositionEnd={() => {
isComposing.current = false isComposing.current = false
}} }}
onUpdateHeight={updateAutocompletePosition} onUpdateHeight={updateAutocompletePosition}>
/> {IS_WEB ? null : textContent}
</AutosizedTextarea>
</View> </View>
{activeFacet && activeFacet.type !== 'url' && ( {activeFacet && activeFacet.type !== 'url' && (
+8 -8
View File
@@ -2413,15 +2413,15 @@
resolved "https://registry.yarnpkg.com/@bsky.app/react-native-mmkv/-/react-native-mmkv-2.12.5.tgz#eb17d31a6158c74393f617a1763ac223ff3f83a6" resolved "https://registry.yarnpkg.com/@bsky.app/react-native-mmkv/-/react-native-mmkv-2.12.5.tgz#eb17d31a6158c74393f617a1763ac223ff3f83a6"
integrity sha512-3vUz1nQY1DiKIPAWRkpp5ZGxH5f2G6Ui0UuQuEYjYv81xx1qFcSzS9KQ2sHcOKYdkOM9amWV2Q8TQCxt1lrAHg== integrity sha512-3vUz1nQY1DiKIPAWRkpp5ZGxH5f2G6Ui0UuQuEYjYv81xx1qFcSzS9KQ2sHcOKYdkOM9amWV2Q8TQCxt1lrAHg==
"@bsky.app/sift@^0.2.9": "@bsky.app/sift@^0.2.11":
version "0.2.9" version "0.2.11"
resolved "https://registry.yarnpkg.com/@bsky.app/sift/-/sift-0.2.9.tgz#517710b850551846482e68c201750d1dfd549792" resolved "https://registry.yarnpkg.com/@bsky.app/sift/-/sift-0.2.11.tgz#ea5f7b3eaa6314b6eab331fba966f5ada6744d00"
integrity sha512-6eQzQ+xKkc0HcGzs96HaadKx+YfaCQwWO52S5VReyxuSii4Xz+bFZ4pjtHnH0NU/lB9W3llMLmjrV+Y5hGozhA== integrity sha512-aQMNwZ78ot4oYMtLPVGOaPn7DQ1y+MeVKRXqLP0dfGNDgw/BKWIaTi/73IcIeM7x41/2J1ncIGKUbAj1vzIoLQ==
"@bsky.app/tapper@^0.4.2": "@bsky.app/tapper@^0.4.3":
version "0.4.2" version "0.4.3"
resolved "https://registry.yarnpkg.com/@bsky.app/tapper/-/tapper-0.4.2.tgz#a01355f87bb17c4767cb66930a9d1e65904b298a" resolved "https://registry.yarnpkg.com/@bsky.app/tapper/-/tapper-0.4.3.tgz#969e3bc33dfd5221d8b74ee9c854e554c51e6db0"
integrity sha512-64+EI5zzIFAMnLFlHFRuS0L26ANCLnMQS1Q4GszOo6/vhWko6opQA0yYowizEFHCQ73uiquaup2Oc8m7pDSxTA== integrity sha512-7nW0EW/SBycX6EpSLYgHNjJd22gGGnutv3hyRKpS0rS9mt9Jtm8qhgkTxpajS338au/KiQRRQGUo8rqdAn7Lfw==
"@crowdin/cli@^4.14.1": "@crowdin/cli@^4.14.1":
version "4.14.1" version "4.14.1"