Diokuz / baron

Native scroll with custom scrollbar
MIT License
776 stars 124 forks source link

Wrong scroll position on field focus with height resize #146

Closed iryska closed 8 years ago

iryska commented 8 years ago

Hi @Diokuz, We have section with fields and scroll. Last item in this section textarea. once user type more than 1 line of text in this textarea, height of textarea and whole section increased. Scroll also increased but stay at the middle on section, so user should remove focus and scroll bottom. Maybe plugin have something that will help us scroll to the bottom of the section when we change height of textarea? I didn't find it in settings.

Thanks

Diokuz commented 8 years ago

Good testcase!

No, there is no 'textarea'-option.

There is a default browser-behaviour:

1

I suppose you use some js-code to make textarea bigger? If so, you need to set scrollTop value of scroller html-node equal to scrollHeight, or just big enough (9999 for example) after the textarea height has changed.

Baron did not set scroll position at all (that is the philosophy of baron), it just paint some things, like custom scrollbar.

Diokuz commented 8 years ago

Does the problem disappear after disabling baron? It should stay. I mean, it is not a baron-problem, I suppose.

iryska commented 8 years ago

thanks, found solution - scroll via js once height changed