Questions tagged [onpress]
156 questions
1
vote
0 answers
onPress handler not working in marker for react native maps?
I am having trouble with the onPress handler in a marker component. onPress never seems to get called because it never calls onMarkerPress which prints out something to the console. Does anyone have this issue?
Here is my code:
const…

Tyra
- 11
- 1
1
vote
2 answers
How to switch screens in Kivy using the python code
My code has the screenmanager and the App class in another python file. I want to cahnge the window from "order_screen" to "order_review" with the press of a button. I can achieve this affect in my kv code (See the second code)
class…

ChrisCross
- 103
- 6
1
vote
3 answers
OnPress() using TouchableOpacity is not working in react-native application
When I click the RoundedButton the TouchableOpacity works i.e the opacity of the button reduces but the onPress function doesn't work, the data being passed to the onPress function is correct(as given in the code below). Also, when I tried to…

abhinav Deshmukh
- 11
- 2
1
vote
0 answers
React Native update scroll view offset on button press
I am a beginner to react native. I would like to know how to change the scrollview's offset on pressing a button because I could not find any props for ScrollView that lets you set the scroll position.The code looks roughly like this, where…

Gagan
- 51
- 8
1
vote
1 answer
Problem when run onpress fonction : react navigation
I would just like to be redirected to my "Profile" page when I click on the "Enter" button. I don't know if this is the correct method but my homepage is App.js and it contains my button and my image. Sorry for the mistakes I am a beginner and…

QuentinIns30
- 11
- 1
1
vote
1 answer
React Native onPress function keeps getting called
I'm trying to run a function in react native where a function gets called when the button is pressed but when the button is pressed once the function keeps running over and over again. How do I fix the code to make this not happen. The add_password…

Robert Beit
- 33
- 2
- 9
1
vote
1 answer
Change the backgroundcolor of Touchable / Pressable Item after pressing
I'm currently working on an app prototype with react native. There's a lot out there on how to change the color of a component, here Touchable or Pressable, when pressing it (=> onPress).
But how do i change the backgroundcolor of such a component…

tab_stopp
- 49
- 1
- 5
1
vote
3 answers
Return JSX component onPress react-native
I want to prompt users to get input onPress but returning JSX from an onPress never worked so whats a possible workaround to return JSX based on button click. Here's my code:
import React, { useState } from 'react';
import {
StyleSheet,
…

Omar Odaini
- 101
- 1
- 7
1
vote
0 answers
delayPressIn, delayPressOut, and delayLongPress disable touchableopacity onPress in react-native 0.62.2?
I just updated a react native project from rn 0.61.5 to rn 0.62.2. Things are mostly fine except that the onPress on my doesn't respond if I have delayPressIn, delayPressOut, or delayLongPress in that same touchable…

Charlotte_Anne
- 344
- 5
- 17
1
vote
3 answers
One touchable opacity doesn't press when another touchable opacity is pressed
I was making a program in React native in which there are two buttons which when pressed will increase a tap counter.
The problem is when one button is pressed the other won't respond and doesn't increase the counter. The button is made with…

Ashish Mathew
- 117
- 1
- 9
1
vote
0 answers
onLongPress triggers instead of onPress for single tap
I have a card item with TouchableOpacity which has both onPress and onLongPress. When I intend to perform onPress action by taping on the record onLongPress gets triggered. This is happening only when remote debugger is enabled. And this is…

ThinkAndCode
- 1,319
- 3
- 29
- 60
1
vote
2 answers
Simplified style change onPress React Native
The following is a first attempt at learning to simply change the style of an element onPress in react native. Being well versed in web languages I am finding it difficult as it is not as straight forward.
For reasons as yet unknown, the element…

Walrus
- 19,801
- 35
- 121
- 199
1
vote
1 answer
How to avoid loop on "on_press" listener event?
I'm writing a very simple piece of code.
I want to listen to the keyboard.
When I press F11, the message "Activated..." must be displayed, just once.
When I press F11 again, the message "Deactivated..." must be displayed, also just once.
And so…
user12572635
1
vote
2 answers
How to update the attribute of an item of a FlatList?
I have programmed an Android app which is consists of a TextInput, a Button and a FlatList. With each name That is written in the TextInput, there will be an item in the flat list. The Item title will be the TextInput content and there will be two…

Elessar
- 93
- 2
- 11
1
vote
3 answers
need to press flatlist child for 2/3 second to actually travel to link
What is happening :
I have a flatlist rendering a component with onPress inside. It is doing the job but i need to press the flatlist for about two or three second so that the onPress fire which is ruining the user experience.
I have tryed…

Nakholz
- 43
- 6