Skip to content

Android: Pressable consumes child native text link presses from react-native-enriched-markdown #475

Closed

Description

@simeonbakalov

Description

On Android, links rendered by react-native-enriched-markdown do not fire onLinkPress when the markdown component is rendered inside a Pressable from react-native-gesture-handler.

The same markdown link works when the parent is React Native's built-in Pressable.

This only reproduces on Android. iOS works as expected.

Environment

  • React Native: 0.83.9
  • react-native-gesture-handler: 2.31.2
  • react-native-enriched-markdown: 0.6.0
  • Platform: Android
  • Architecture: New Architecture enabled

Reproduction

import React from "react"
import { Alert, Pressable as RNPressable, Text, View } from "react-native"
import { Pressable as RNGHPressable } from "react-native-gesture-handler"
import { EnrichedMarkdownText } from "react-native-enriched-markdown"

const markdown = "Open [gesund.de](https://gesund.de)"

export function Repro() {
  return (
    <View style={{ padding: 24 }}>
      <Text>RNGH Pressable parent - link does not fire on Android</Text>

      <RNGHPressable
        onPress={() => {
          console.log("parent RNGHPressable pressed")
        }}
        style={{ padding: 16, backgroundColor: "#eee" }}>
        <EnrichedMarkdownText
          markdown={markdown}
          flavor="github"
          markdownStyle={{
            paragraph: {
              fontSize: 16,
              lineHeight: 24,
              color: "#000",
            },
            link: {
              color: "#000",
              underline: true,
            },
          }}
          onLinkPress={({ url }) => {
            console.log("markdown link pressed", url)
            Alert.alert(url)
          }}
        />
      </RNGHPressable>

      <Text>RN Pressable parent - link works</Text>

      <RNPressable
        onPress={() => {
          console.log("parent RNPressable pressed")
        }}
        style={{ padding: 16, backgroundColor: "#eee" }}>
        <EnrichedMarkdownText
          markdown={markdown}
          flavor="github"
          markdownStyle={{
            paragraph: {
              fontSize: 16,
              lineHeight: 24,
              color: "#000",
            },
            link: {
              color: "#000",
              underline: true,
            },
          }}
          onLinkPress={({ url }) => {
            console.log("markdown link pressed", url)
            Alert.alert(url)
          }}
        />
      </RNPressable>
    </View>
  )
}

Activity

  1. self-assigned this
    on Jul 2, 2026
  2. hryhoriiK97 commented on Jul 2, 2026

    @hryhoriiK97
    Collaborator

    Hi @simeonbakalov, I've merged the fix for this issue. It will be included in today's v0.7.0 release

  3. simeonbakalov commented on Jul 7, 2026

    @simeonbakalov
    Author

    Hey @hryhoriiK97 nice work!

    it works on the android emulator. However on a PHYSICAL device the problem seems to still be active.
    I would be very thankful if you fixed it there as well,

    Thanks in advance :)

  4. hryhoriiK97 commented on Jul 7, 2026

    @hryhoriiK97
    Collaborator

    Hi @simeonbakalov, just tested on a physical device and it looks like it's working the same way as on the emulator. I can't reproduce this problem. Do you have any specific reproduction?

  5. added 4 commits that reference this issue on Jul 7, 2026
    b16ecb9
    68ea7e7
    6da9b64
    957e5ee
  6. simeonbakalov commented on Jul 8, 2026

    @simeonbakalov
    Author

    Hey,
    it seems that i had cache problems after I upgraded the version. Now everything is working fine
    Thanks!

  7. added a commit that references this issue on Jul 15, 2026
    3512340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions