Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TouchableWithoutFeedback does not support style #44070

Open
famdude opened this issue Apr 13, 2024 · 2 comments
Open

TouchableWithoutFeedback does not support style #44070

famdude opened this issue Apr 13, 2024 · 2 comments
Labels
Component: TouchableWithoutFeedback Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍

Comments

@famdude
Copy link

famdude commented Apr 13, 2024

Description

the TouchableWithoutFeedback component does not support styling.
There was another issue about this problem which is closed, and not fixed. it was suggested to add a View inside TouchableWithoutFeedback and add style to View.
But it does not fix the problem! for example if if you want to create a circular TouchableWithoutFeedback, that is only touchable from inside the circle (onPress be called only if the circle area is touched), you should be able to add a borderRadius style to TouchableWithoutFeedback component itself.

Steps to reproduce

create a TouchableWithoutFeedback component, and add style to it.

React Native Version

0.73.6

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

System:
  OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  CPU: (16) x64 13th Gen Intel(R) Core(TM) i7-13620H
  Memory: 20.65 GB / 31.07 GB
  Shell:
    version: 5.8.1
    path: /usr/bin/zsh
Binaries:
  Node:
    version: 20.12.1
    path: ~/.nvm/versions/node/v20.12.1/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v20.12.1/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: AI-232.10300.40.2321.11567975
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found


### Stacktrace or Logs

```text
no log

Reproducer

http://localhost:3000

Screenshots and Videos

No response

@github-actions github-actions bot added Component: TouchableWithoutFeedback Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Apr 13, 2024
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@mensonones
Copy link

mensonones commented Apr 24, 2024

Hey, @famdude! Check this custom file to support styling in the component
https://gist.github.com/mensonones/d615f87ea752e181164e5170f115c0f8

After change file. Use

<TouchableWithoutFeedback onPress={() => Alert.alert('Hello, world!')} style={styles.button}>
    <Text style={styles.paragraph}>Press me!</Text>
 </TouchableWithoutFeedback>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: TouchableWithoutFeedback Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

2 participants