react-native-paper
react-native-paper copied to clipboard
Appbar.Content with "editable title" - can't desplay TextInput
I want to create an Appbar with an editable title, so I used:
import * as React from 'react';
import { Appbar } from 'react-native-paper';
import {TextInput} from 'react-native';
const MyComponent = () => (
<Appbar.Header>
<Appbar.Content title={<TextInput defaultValue="My Title" />} />
</Appbar.Header>
);
export default MyComponent;
https://snack.expo.dev/79DPPKlWc
But the TextInput isn't displayed at all on Android. Other components like Text are working.
Is there any way to create an editable title with Appbar?
react-native: 0.69.2react-native-paper: 4.12.3react-native-vector-icons: 9.2.0
Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).
Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.
Couldn't find version numbers for the following packages in the issue:
react-nativereact-native-paperreact-native-vector-icons
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
For a mode="small" appbar a simple flexed view can be used in place of the Appbar.Content however this workaround won't work for the other modes
I think that Material Design doesn't allow to use of editable components like TextInput within the Appbar. I'm closing the issue since most likely we are not going to investigate it or add support for that