اذهب إلى المحتوى
  • 0

المدخلات النصية لا تعمل كالمتوقع على iOS React Native

عمر سالم2

السؤال

احاول عمل focus على المدخل النصي التالي بعد الانتهاء من الاول، ولكنها لا تعمل على iOS بالشكل الصحيح، حيث ان الـ keyboard يحدث بها خلل..

export default function App() {
  const nextRef = React.useRef(null);

  return (
    <View style={styles.container}>
      <Text style={styles.heading}>تسجيل الدخول</Text>
      <TextInput
        onSubmitEditing={() => { nextRef.current.focus() }}
        style={styles.textInput} />
      <TextInput
        ref={nextRef}
        style={styles.textInput} />
    </View>
  );
}

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

  • 0

يوجد خاصية متاحة للـ TextInput تسمى blurOnSubmit. تعمل هذه الخاصية على عمل blur بعد ان تنتهي من الكتابة، لذا يمكنك حل المشكلة عن طريق ضبطه لـ false وستعمل بشكل سليم بعدها.

export default function App() {
  const nextRef = React.useRef(null);

  return (
    <View style={styles.container}>
      <Text style={styles.heading}>تسجيل الدخول</Text>
      <TextInput
        onSubmitEditing={() => { nextRef.current.focus() }}
        blurOnSubmit={false}
        style={styles.textInput} />
      <TextInput
        ref={nextRef}
        style={styles.textInput} />
    </View>
  );
}

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...