react-native-htmlview icon indicating copy to clipboard operation
react-native-htmlview copied to clipboard

Only half width of an img is being clickable if placed under <a/> tag of html

Open Dheeeraj opened this issue 7 years ago • 5 comments

if i place an img tag inside a tag of my html only 50% of img width is being clickable i tried with different widths still no change only half of it is getting clickable

Dheeeraj avatar Jun 29 '18 13:06 Dheeeraj

+1

banli17 avatar Jul 06 '18 01:07 banli17

if (node.name == "img") {
            return (
                <Image key={index} source={{uri: node.attribs.src}} style={{width: WinWidth,height:WinHeight}}/>
            );
        }

but half width of window

banli17 avatar Jul 06 '18 01:07 banli17

i use react-native-render-html last

banli17 avatar Jul 06 '18 01:07 banli17

it works for me

<Text
          key={index}
          onPress={() =>
            this.clickImage(node.attribs.src)
          }
        >
          <Image
            source={{ uri: node.attribs.src}}
            style={{ width: 100, height: 100, resizeMode: "cover" }}
          />
          &nbsp; // !!!!!!!
</Text>

nikita-khrustalev avatar Sep 03 '18 09:09 nikita-khrustalev

like this,i have resolve add a <View>

` <HTMLView renderNode={(node: HTMLViewNode, idx) => { if (node.name == 'img') { const a = node.attribs; return ( <View key={idx}> <Image resizeMode="cover" style={{ resizeMode: 'cover', width: mpx(20), height: mpx(20), }} source={{uri: a.src}} /> </View> ); } }} value={messageBody?.text as string} />

`

withwz avatar Nov 25 '21 15:11 withwz