'Unity how to make dropdown automatically select an option when scrolling?

I am trying to get unity's dropdown automatically select (currently say the centre) option when scrolling. Then by applying elasticity, it may cover the full range of items.

As far as I know, it may be done by registering an event that get the current area of the visible panel and then looks for the item that covers the center of the visible panel.

I don't know how to get the area of the visible panel, nor do I know the way to get the item according to its location in the panel. Can anyone please give some idea.



Solution 1:[1]

Set the default value of the dropdown by setting the Value property to the index of option you want in the DropDown UI component.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ina