callstack / callstack/react-native-pager-view
[Real device] TextInput cannot trigger the paste function in ViewPage
まだ誰も着手していません。
- 主要言語
- 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.

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>
);
};

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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
報告された Xiaomi または Huawei のデバイスを使用して、Android 10 上の ViewPager にネストされた TextInput の例を再現し、初回のレンダリングと再レンダリングの場合を比較します。ネストされた TextInput が再レンダリングを必要とせずに貼り付けをトリガーできれば完了です。報告ではソースファイルやテストは指定されていません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, react-native, typescript
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100