react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

TextField - ClearButton customizations

Open zrina1314 opened this issue 8 months ago • 2 comments

I need to customize the clean button component because I'm using svg ICONS

zrina1314 avatar Apr 23 '25 06:04 zrina1314

@zrina1314 Hi. What do you need to change in the ClearButton? Is passing buttonProps instead of custom element can be enough?

Inbal-Tish avatar Apr 29 '25 12:04 Inbal-Tish

My intent is to replace the default ClearButton icon。 But now it seems you can't replace ICONS, just style them. Even ICONS aren't styled perfectly.

  1. Allow me to change ICONS and icon styles

 return (
    <View reanimated style={style} testID={`${testID}.container`}>
      <Button
        link
        iconSource={Assets.internal.icons.xFlat}     ////  I want to change this
        iconStyle={styles.clearIcon}                    ////  I want to change this
        onPress={clear}
        hitSlop={hitSlop}
        accessible={hasValue}
        accessibilityLabel={'clear'}
        testID={testID}
      />
    </View>
  );

OR

  1. Allow me to replace Button with my own Icon component // The IconFont component is a 'react-native-vector-icons' wrapper component, which is a Font icon

 return (
    <View reanimated style={style} testID={`${testID}.container`}>
      <Button
        link
       
        iconSource={<IconFont name='icon_m_clear' size={20} color={Colors.grey100}   onPress={clear}/> }       ////  I want to change this
        onPress={clear}
        hitSlop={hitSlop}
        accessible={hasValue}
        accessibilityLabel={'clear'}
        testID={testID}
      />
    </View>
  );

zrina1314 avatar May 09 '25 07:05 zrina1314