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

textinput value from state reverts, need to tap text twice for it to save or tap backspace twice to delete iOS #48011

Open
tburnt opened this issue Nov 29, 2024 · 5 comments
Labels
Component: TextInput Related to the TextInput component. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: iOS iOS applications.

Comments

@tburnt
Copy link

tburnt commented Nov 29, 2024

Description

When I use type in a character or delete a character it flickers and puts back the character or deletes the character

The following is my code
//import area
import {
StyleSheet,
View,
Text,
Image,
TouchableOpacity,
Appearance,
ScrollView,
Platform,
TextInput as NativeTextInput
} from 'react-native';

//constructor in the component
constructor(props) {
super(props);
this.state = {
background_color: '#5c5c5c',
user_data: [],
expandSttGeneralList: false,
expandSttList: false,
expandSttSellList: false,
expandUserGeneralList: false,
expandUserList: false,
expandUserSellList: false,
introductionModal: false,
introductionPage1: true,
stt_general_buy_rules: [],
stt_general_buy_rules_list: <></>,

  stt_buy_rules: [],
  stt_buy_rules_list: <></>,

  stt_sell_rules: [],
  stt_sell_rules_list: <></>,

  user_general_buy_rules: [],
  user_general_buy_rules_list: <></>,

  user_buy_rules: [],
  user_buy_rules_list: <></>,

  user_sell_rules: [],
  user_sell_rules_list: <></>,

  openRuleModal: false,
  openDeleteRuleDialog: false,
  rule_id: 0,
  rule_list_id: 0,
  rule_description: '',
  rule_type: '',
};

this.utilHelper = new UtilityHelper();
this.dbHelper = new DatabaseHelper();
this.rulesModel = new Rules();
this.rulesListModel = new RulesList();
this.willFocusSubscription;
this.systemDarkThemeListener;
this.temp_description = '';
//this.handleTextChange = this.handleTextChange.bind(this);

}

//script callback when textchange
iOShandleTextChange(text) {

 this.setState({ rule_description: text }, ()=>{
  console.log(this.state.rule_description);
});

};

//textinput
<NativeTextInput
numberOfLines={3}
maxLength={1000}
value={this.state.rule_description}
onChangeText={text => this.iOShandleTextChange(text)}
style={{ width: '100%', height: 800, padding: 10, fontSize: 15, textAlign: "center" }}
/>

Pls help this has been frustrating

Steps to reproduce

  1. Add TextInput and recover value from state
  2. Try to edit

React Native Version

0.74.1

Output of npx react-native info

none

Screenshots and Videos

IMG_5053.1.MP4
@tburnt tburnt added Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Triage 🔍 labels Nov 29, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. labels Nov 29, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@tburnt
Copy link
Author

tburnt commented Nov 29, 2024

adding the 74.6 patch does not work the textinput acts the same

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Nov 29, 2024
@cortinico cortinico added Needs: Author Feedback and removed Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Attention Issues where the author has responded to feedback. labels Nov 29, 2024
@dhruvpvx
Copy link

This is a issue in react native 0.76.3
I don't know why other TextInputs are working fine but only issue with a sepsefic one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: TextInput Related to the TextInput component. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

4 participants