Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render content from the bottom #26

Open
EmiM opened this issue Apr 27, 2021 · 2 comments
Open

Render content from the bottom #26

EmiM opened this issue Apr 27, 2021 · 2 comments

Comments

@EmiM
Copy link

EmiM commented Apr 27, 2021

Hello, is there a legitimate way to render content from the bottom?
We used this renderView:

const renderView = props => {
  const style = {
    ...props.style,
    display: 'flex',
    flexDirection: 'column-reverse'
  }
  return <div {...props} style={style} />
}

But somehow it stopped working properly and if we use it, the scrollbar starts at the top and doesn't want to go down (only up).
What we want to achieve is similar to what you can see in chats - scroll starting at the bottom and going up.
Here is the example with renderVIew I mentioned: https://codesandbox.io/s/confident-fermi-n3q9q?file=/src/SpringScrollbarsExample.js

@Tomassito
Copy link
Contributor

Hello @EmiM
Why not use this.refs.scrollbars.scrollBottom(); on comonentDidMount , remove the flex styling and order the internal data the way you want before you provide it to the component?

@EmiM
Copy link
Author

EmiM commented Apr 28, 2021

Thank you for the response. Yeah, scrollToBottom solves one problem but now I know why we used the 'column-reverse' (it was implemented before I became involved in the project). We load the content - messages - and at the beginning they appear one by one so the column-reverse has been used to enforce rendering them from the bottom.
It worked till we upgraded electron from 8 to 12 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants