mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Update OptionDropDown value when items change
Items of OptionDropDown could previously already be changes on-the-fly, but the selected value was not correctly updated (it kept the same index). This commit addresses this problem.
This commit is contained in:
@ -71,7 +71,14 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
items = value;
|
items = value;
|
||||||
if(dropdown != null)
|
if(dropdown != null)
|
||||||
|
{
|
||||||
dropdown.Items = value;
|
dropdown.Items = value;
|
||||||
|
|
||||||
|
// We need to refresh the dropdown because our items changed,
|
||||||
|
// thus its selected value may be outdated.
|
||||||
|
if (bindable != null)
|
||||||
|
dropdown.SelectedValue = bindable.Value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user