callstack / callstack/react-native-pager-view

[Real device] TextInput cannot trigger the paste function in ViewPage

オープン
#278 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

android bug
主要言語
TypeScript
スター
3.4k
フォーク
476
平均マージ
10日 21時間
マージ済み PR(30日)
2

説明

Ask your Question

Thanks for providing such a great library. In the process of using it recently, I found that if TextInput is nested in ViewPage, TextInput cannot trigger the paste function, please see the animation below.

reportView

here is my code

import React, { useEffect, useCallback } from 'react';
import { View, Text, TextInput } from 'react-native';
import ViewPager from '@react-native-community/viewpager';


const App = () => {
  return (
    <View style={{ flex: 1 }}>
      <TextInput
        placeholder="placeholder"
        style={{ borderWidth: 1, borderColor: 'red' }}
      />

      <ViewPager style={{ flex: 1 }}>
        <View style={{ flex: 1 }}>
          <TextInput
            placeholder="TextInput in ViewPage"
            style={{ borderWidth: 1, borderColor: 'red' }}
          />
        </View>
        <View style={{ flex: 1, backgroundColor: 'red' }} />
      </ViewPager>
    </View>
  );
};



I accidentally discovered that if the textinput is re-rendered, the paste function is restored.
here is my code

const App = () => {
  const [visible, setVisible] = useState(false);

  return (
    <View style={{ flex: 1 }}>
      <TextInput
        placeholder="placeholder"
        style={{ borderWidth: 1, borderColor: 'red' }}
      />

      <ViewPager style={{ flex: 1 }}>
        <View style={{ flex: 1 }}>
          {visible && (
            <TextInput
              placeholder="TextInput in ViewPage"
              style={{ borderWidth: 1, borderColor: 'red' }}
            />
          )}
          <Button
            title="make TextInput reRender"
            onPress={() => {
              setVisible(true);
            }}
          />
        </View>
        <View style={{ flex: 1, backgroundColor: 'red' }} />
      </ViewPager>
    </View>
  );
};

 2021-01-01 19 07 03

I don't know what happened and why the paste function will not work. Is this a bug? Finally, thank you for reading this question during your busy schedule and looking forward to your reply, thank you.

iOS work fine. no try it

Library :

react-native : 0.63.2
@react-native-community/viewpager: ^4.2.2,

device :

device : xiaomi(android10) and huawei

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

報告された Xiaomi または Huawei のデバイスを使用して、Android 10 上の ViewPager にネストされた TextInput の例を再現し、初回のレンダリングと再レンダリングの場合を比較します。ネストされた TextInput が再レンダリングを必要とせずに貼り付けをトリガーできれば完了です。報告ではソースファイルやテストは指定されていません。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, react-native, typescript
領域
mobile
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。