react-chatview icon indicating copy to clipboard operation
react-chatview copied to clipboard

Optionally fill an incomplete screen from the bottom

Open bgribble opened this issue 8 years ago • 2 comments

Really liking react-chatview for my application, thanks!

I am doing a chat-type view with an input at the bottom and the react-chatview containing history of utterances above. I pin the containing <div> to fill the available space in the single-page app.

I would really like a newly-created chat thread to grow from the bottom upward, like a teletype session, so that history just starts scrolling off the top as more utterances are added. What it does instead is display the first message at the top of the screen, then grow downward as more chatting happens (newer messages on bottom, of course, since I specify flipped={true}) until scrolling kicks in and then it starts pushing history off the top of the screen.

A screenshot of a short chat thread that doesn't yet fill up a screen:

screen shot 2017-08-31 at 3 28 26 pm

an option like fillFromBottom={true} would be awesome

bgribble avatar Aug 31 '17 19:08 bgribble

Reproduced in both the fiddle and the messages demo: image

in messages demo, in the js console, type cursor.refine('messages').set([])

dustingetz avatar Sep 01 '17 13:09 dustingetz

Can this be resolved using css only? I got close:

image

(see element inline styles set in screenshot - { position:absolute; bottom: 55px }

image

I wasn't able to get a polished solution in the amount of time i spent. I am not sure how i would implement a fillfrombottom - i think the solution would need css and the reason react-chatview is good is because it just uses browser layout without forcing css on you

dustingetz avatar Sep 01 '17 13:09 dustingetz