withNextInputAutoFocus doesn't work with FlatList
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, react-native
- 領域
- mobile
調査の方向性
src/withNextInputAutoFocus.js、特に issue で参照されている getInputs ロジックから始め、提供されている FlatList/FieldArray の例を再現してください。FlatList の renderItem を通じてレンダリングされた inputs がどのように検出されるかを確認してください。done は最後の input にのみ表示され、それより前の inputs には next が表示されるはずです。
索引モデルが issue の本文から書いたものです。
説明
Hi,
i use a FlatList inside a FieldArray inside a component wrapped with withNextInputAutoFocusForm
Current behavior
inputs inside the FlatList always have the done button
Expected behavior
inputs inside the FlatList should display the next button when this is not the last
Technical detail
FlatList has a renderItem prop but doesn't have the children prop
so, getInputs can find the inputs because it search children prop
Demo
import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react-native';
import { FieldArray, Formik } from 'formik';
import React from 'react';
import { FlatList, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { handleTextInput, withNextInputAutoFocusForm, withNextInputAutoFocusInput } from 'react-native-formik';
import { compose } from 'redux';
const TextField = compose(
handleTextInput,
withNextInputAutoFocusInput,
)(TextInput);
const NextInputAutoFocus = withNextInputAutoFocusForm(View);
const initialFormValues = { someList: ['first item', 'second item', 'third item'] };
storiesOf('fields', module).add('fieldArray', () => (
<Formik initialValues={initialFormValues} onSubmit={action('submit')}>
{({ handleSubmit }) => (
<NextInputAutoFocus>
<FieldArray name="someList">
{() => (
<FlatList
data={initialFormValues.someList}
renderItem={({ index }) => <TextField name={`someList[${index}]`} />}
keyExtractor={(_item, index) => index.toString()}
/>
)}
</FieldArray>
<TouchableOpacity onPress={handleSubmit}>
<Text>Submit</Text>
</TouchableOpacity>
</NextInputAutoFocus>
)}
</Formik>
));
It seems related to this issue https://github.com/bamlab/react-native-formik/issues/42 but i'm not sure this is the same problem
Thanks for this module : it's simple and usefull
- 主要言語
- JavaScript
- スター
- 397
- フォーク
- 47
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bamlab/react-native-formik のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bamlab/react-native-formik#173 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bamlab/react-native-formik#162 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
bamlab/react-native-formik#156 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
bamlab/react-native-formik#142 · コメント 4 件 · リアクション 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
bamlab/react-native-formik#141 ·
bamlab/react-native-formik の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
account: profile bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 5 日以内に返信
-
ai-driven-fuzzing bug claude Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
linagora/cozy-client#1777 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
NanmiCoder/dsh-agent-teams#326 ·
メンテナーはふだん 1 日以内に返信
-
[guide] AGENTS.md claims the coverage gate, e2e and full lint run on every PR after ADR 0011 focused validation対応中かも @hivecommons-hive が今日担当しました。 オープンagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
cncf/endusers#2006 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信