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

nb-chat scroll bar rescrolls to the bottom of the container whenever view is updated. #921

Closed
1 of 2 tasks
stubbsy345 opened this issue Oct 18, 2018 · 2 comments
Closed
1 of 2 tasks

Comments

@stubbsy345
Copy link

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

I am using the nb-chat component with a component adjacent to it containing a counter. Every time the counter updates the nb-chat scroll automatically scrolls to the bottom. I have not managed to come up with a work around as of yet, however, have not had a chance to have a proper look at it.

I believe the problem is this life hook:

-->

ngAfterViewChecked() { 
      this.scrollable.nativeElement.scrollTop = this.scrollable.nativeElement.scrollHeight; 
}

Other information:

npm, node, OS, Browser

<!--
Node, npm: `node --version` and `npm --version`
OS: Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
Browser: Chrome/Safari/Firefox/etc?
-->

Angular, Nebular

2.0.0rc10
@stubbsy345
Copy link
Author

Is there a possible work around I can build in for now. My project relies heavily around the chat component. I am happy to fix this myself but probably won't have time in the next 2 weeks so would be helpful if there was a workaround in the mean time.

@nnixaa nnixaa modified the milestones: 3.0.0, 3.0.1 Nov 19, 2018
nnixaa added a commit that referenced this issue Nov 19, 2018
So that it is possible to control `scroll to bottom` reaction on a new message
Also closes #921
@nnixaa
Copy link
Collaborator

nnixaa commented Nov 19, 2018

@stubbsy345 thanks for reporting. There will be a fix in the next version, if you are pressed for time you can implement a custom nb-chat component having this fix in place, and then replace it once we release @nebular/theme@3.0.1. Here is a link to the fix #1001.

nnixaa added a commit that referenced this issue Nov 19, 2018
So that it is possible to control `scroll to bottom` reaction on a new message
Also closes #921
@nnixaa nnixaa closed this as completed in d393f33 Nov 20, 2018
@issue-sh issue-sh bot removed the Backlog label Nov 20, 2018
rubenXaus pushed a commit to rubenXaus/nebular that referenced this issue Nov 23, 2018
So that it is possible to control `scroll to bottom` reaction on a new message
Also closes akveo#921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants