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

Inline Style not working

Open gowdruNikhil opened this issue 4 years ago • 3 comments

<p> Add <span style="color:green">₹56</span> more to cart for <span style="color:green">FREE</span> Delivery</p>

the color green is not applying on the span tagged elements

gowdruNikhil avatar Jan 29 '21 09:01 gowdruNikhil

Not very elegant but I tricked it by recreating a custom node with the data inside.

Hope it will help few other like me :)

 if (node.name == 'span') {
      const data = node.children[0].data;
      const width = Dimensions.get('window').width;
      return (
          <View key={index} style={{ backgroundColor: 'red', borderRadius: 12, padding: 14, width: width - 24 }}>
              <Text style={{color: '#FFFFFF', fontSize: 14, lineHeight: 24}} >
                  {data}
              </Text>
          </View>
      )
} 

rianfloo avatar Apr 20 '22 16:04 rianfloo

Please provide an version update with this Fix.

KarthikBaleneni avatar Dec 12 '22 08:12 KarthikBaleneni

Do we have any updates? Please

tuanphamhnl avatar Mar 07 '23 07:03 tuanphamhnl