Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow text selection of the post being replied to in composer #3346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haileyok
Copy link
Contributor

Why

Users frequently want to be able to pull a piece of text out of the post they are replying to. By adding the selectable prop to the ComposerReplyTo's Text, we can easily allow users to do this.

We also need to add a dummy callback to the onLongPress here so that the Pressable does not interfere with the native press and hold to select.

@@ -100,7 +110,8 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) {
<Text
type="post-text"
style={pal.text}
numberOfLines={!showFull ? 6 : undefined}>
numberOfLines={!showFull ? 6 : undefined}
selectable>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a selectable uitextview? Would that cause issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This <Text> does that underneath in

if (selectable && isIOS) {

(Reminds me though that we can also merge this in #3090, has a few fixes that came up from other people using it)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my bad, should've checked that :)

@pfrazee
Copy link
Collaborator

pfrazee commented Apr 4, 2024

Tested on iOS and Android, works well.

But I think the letter spacing changed on iOS? or maybe the font weight or the aliasing or something?

Reply in composer In feed
CleanShot 2024-04-03 at 19 37 19@2x CleanShot 2024-04-03 at 19 38 00@2x

@haileyok
Copy link
Contributor Author

haileyok commented Apr 4, 2024

Oh interesting. Looks like it's that way in prod as well. Let me see if I can just hit that real quick here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants