react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Appbar.Content with "editable title" - can't desplay TextInput

Open rhalaly opened this issue 3 years ago • 3 comments

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.2
  • react-native-paper: 4.12.3
  • react-native-vector-icons: 9.2.0

rhalaly avatar Jul 25 '22 11:07 rhalaly

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.

github-actions[bot] avatar Jul 25 '22 11:07 github-actions[bot]

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-paper
  • react-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.

github-actions[bot] avatar Jul 25 '22 11:07 github-actions[bot]

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

hbriese avatar Aug 03 '22 04:08 hbriese

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

lukewalczak avatar Mar 31 '23 13:03 lukewalczak