Giter VIP home page Giter VIP logo

Comments (6)

Tomassito avatar Tomassito commented on July 26, 2024

Is this what you want to achieve?
https://codesandbox.io/s/react-fiddle-forked-h8fvx?file=/src/App.js

BTW. there are functions that you can call on the Scrollbars instance (that you can get a hold of using refs):
scrollToTop
scrollToBottom
scrollToRight
scrollToLeft

from rc-scrollbars.

JumpAttacker avatar JumpAttacker commented on July 26, 2024

i dont need only to btm, some times i need to go not to the last element

and i told you about dat
image

i want to use scrollIntoView with options {block: 'center} but if im using it i got dat

for me is hard to use scrollToTop cuz my content height inside this scroll are dynamic

from rc-scrollbars.

Tomassito avatar Tomassito commented on July 26, 2024

You can scroll into any position you like with Scrollbars.scrollTop(placeYouWantToScrollInto). See the Spring Scrollbars example that also uses rebound for a smoother effect.
The options you wanted to use are experimental anyway and should not be used.

from rc-scrollbars.

JumpAttacker avatar JumpAttacker commented on July 26, 2024

but you know easy way to get item's position inside scroll? I only know basic: item.height*x, but i have dynamic height on items, so its hard for me to calc all items (i know it possible, but easiest way to use just scrollIntoView)

from rc-scrollbars.

Tomassito avatar Tomassito commented on July 26, 2024

Element.offsettop would be my first call. Anyway it's more like stackoverflow question than Scrollbars related.
As described above, you are encouraged to use the API to scroll within it rather than using scrollInto etc. browser API.
Otherwise you may see such artifacts as the original scrollbars being pulled from under the negative margins.

Unless you have any more issues to raise, I assume your case to be closed?

from rc-scrollbars.

JumpAttacker avatar JumpAttacker commented on July 26, 2024

yes, thanks for help

from rc-scrollbars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.