[Textarea] Scroll position changes unexpectedly
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### Bug, feature request, or proposal:
Bug
#### What is the expected behavior?
When filling a textarea, we should see what we are writing :-)
#### What is the current behavior?
Under some conditions, writing inside a textarea with autoSize directive makes the page scroll position changes (we get scrolled up ? sorry for my english).
#### What are the steps to reproduce?
To reproduce my issue:
- With latest firefox (tested on macOS), open https://angular-material2-issue-pnr2sj.stackblitz.io/
- Scroll down the page.
- Enter the textarea and press any key.
- Your scroll position changes on the page, most of the textarea content isn't visible anymore, which is very annoying for writing.
It also happens on iOS 11 when the textarea is inside a parent with scroll overflow (not the case on the stackblitz example, but I can create another one if needed). I cannot reproduce it on Chrome and I haven't tested other browsers.
I believe the issue is related to [this line](https://github.com/angular/material2/blob/master/src/lib/input/autosize.ts#L197), the parent's height get shorter for an instant which explains we get scrolled up.
#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Latest Angular and Material
コントリビューションガイド
調査の方向性
src/lib/input/autosize.ts の197行目付近から始め、リンク先の StackBlitz の例を Firefox で使用して問題を再現し、その後、textarea が iOS 上で scroll overflow を持つ親要素内にある場合の動作と比較します。textarea autoSize への入力によってページまたは親要素のスクロール位置が変わらなくなり、入力中のコンテンツが表示されたままになれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100