Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug [Fixed in 2019.3^] ScrollView.ScrollTo works weird when trying it's child's child

Discussion in 'UI Toolkit' started by Creta_Park, Aug 17, 2019.

  1. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76
    weird scroll.gif

    I think scrollView.ScrollTo(VisualElement) is getting scroll offset by just it's parent element, not by scrollView.
     
  2. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76
    weird scroll2.gif
    here's more example.
    when select item, it will calls to ScrollView to scroll to itself. (ScrollView.ScrollTo(this))
     
  3. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    771
    Hello, is it possible for you to report this as a bug with that window via the Bug Reporter (Inside Unity, from the top menu : Help > Report a bug...)?

    Thanks
     
    Creta_Park likes this.
  4. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76
    My project is so huge size, so can I instead attach make reproduced project?
     
  5. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    771
    You can select just the relevant files from the bug reporter :)
     
    Creta_Park likes this.
  6. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76

    Attached Files:

    Last edited: Aug 21, 2019
  7. Dunskat

    Dunskat

    Joined:
    Oct 17, 2017
    Posts:
    11
  8. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    492
    Hello!

    This bug will be fixed for 2019.3, in the meanwhile, if you really want a workaround, you could compute the distance between the element you want to scrollTo and the contentviewport using worldBound. Then change the scrollOffset according to the delta calculated.
     
    Creta_Park likes this.
  9. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76
    Yes, can calculate every element's height to get determine how scrollview should move to some element's offset,
    but in my case is so complex thing about layout structure.

    So I'll wait for fix it as well...

    noooooo
     
  10. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76
    upload_2019-9-19_17-50-37.png


    It's fixed in 2019.3^
     
    Last edited: Sep 19, 2019