callstack / callstack/react-native-paper

TextInput multiline on web should expand when entering long text

オープン
#3,124 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る
repro provided TextInput
主要言語
TypeScript
スター
14.5k
フォーク
2.2k
平均マージ
5日 23時間
マージ済み PR(30日)
12

説明

### Current behaviour
A multiline `TextInput` element expands to adapt to text content on mobile, but it doesn't on web. Instead a scrollbar appears inside the `textarea`

### Expected behaviour

`TextInput` expands on web to adapt to text length, like it does on mobile. This is expected under the material guidelines: https://material.io/archive/guidelines/components/text-fields.html#text-fields-field-types

### Code sample

https://snack.expo.dev/@raphaelmerx/textinput

### Screenshots (if applicable)

Screenshot 2022-03-19 at 12 18 15

### What have you tried

Adapting the height through `onContentSizeChange`, however the textarea never shrinks in size when deleting text:
```javascript
const [height, setHeight] = useState(undefined)
{
setHeight(event.nativeEvent.contentSize.height)
}}
style={{ height }}
/>
```

### Your Environment

| software | version
| --------------------- | -------
| ios or android | web
| react-native | 0.64.3
| react-native-paper | 4.11.2
| node | v14.18.1
| npm or yarn | yarn
| expo sdk | 43

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

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

評価

この issue はまだ評価されていません。

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

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