React-native-vector-icons: Icons that use onPress should have opacity touch effect (TouchableOpacity)

Created on 1 Oct 2019  路  2Comments  路  Source: oblador/react-native-vector-icons

RN's documentation describes:

TouchableWithoutFeedback
Do not use unless you have a very good reason. All elements that respond to press should have a visual feedback when touched.

As such icons which use onPress should have an opacity effect coming from TouchableOpacity. TouchableHighlight is not ideal for this because

  1. the box around the icon is larger with padding, making the highlight look broken
  2. hitSlop isn't functioning and it's not ideal to want the touch hitbox to be as small as the icon itself
  3. all other icons (e.g. those provided by React Navigation) use the opacity effect on the individual icon, not on the padding surrounding it.

Most helpful comment

Ideal solution: provide an icon with a functioning hitSlop and an opacity effect around only the icon rather than a highlight effect around the whole padded area

All 2 comments

Ideal solution: provide an icon with a functioning hitSlop and an opacity effect around only the icon rather than a highlight effect around the whole padded area

Hi guys, any update on this,
I am willing to help here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AbhayVarshney picture AbhayVarshney  路  3Comments

arjs1000 picture arjs1000  路  3Comments

fevzican picture fevzican  路  3Comments

mahdidavoodi7 picture mahdidavoodi7  路  3Comments

venux92 picture venux92  路  3Comments