mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 06:28:35 +01:00
Fixed dropdowns with some non-selectable children failing to navigate when using gamepad controls
This commit is contained in:
parent
1f4f0cfa44
commit
c5b2b8798e
2 changed files with 3 additions and 2 deletions
|
@ -62,6 +62,7 @@ Fixes
|
||||||
- Fixed buttons and checkboxes changing their CanBeSelected and CanBePressed values when being disabled
|
- Fixed buttons and checkboxes changing their CanBeSelected and CanBePressed values when being disabled
|
||||||
- Fixed children of Panel scroll bars also being scrolled
|
- Fixed children of Panel scroll bars also being scrolled
|
||||||
- Fixed RootElement.CanSelectContent and Element.IsSelected returning incorrect results when CanBeSelected changes
|
- Fixed RootElement.CanSelectContent and Element.IsSelected returning incorrect results when CanBeSelected changes
|
||||||
|
- Fixed dropdowns with some non-selectable children failing to navigate when using gamepad controls
|
||||||
|
|
||||||
Removals
|
Removals
|
||||||
- Marked StyleProp equality members as obsolete
|
- Marked StyleProp equality members as obsolete
|
||||||
|
|
|
@ -63,10 +63,10 @@ namespace MLEM.Ui.Elements {
|
||||||
if (dir == Direction2.Left || dir == Direction2.Right)
|
if (dir == Direction2.Left || dir == Direction2.Right)
|
||||||
return null;
|
return null;
|
||||||
if (dir == Direction2.Up) {
|
if (dir == Direction2.Up) {
|
||||||
var prev = element.GetOlderSibling();
|
var prev = element.GetOlderSibling(e => e.CanBeSelected);
|
||||||
return prev ?? this;
|
return prev ?? this;
|
||||||
} else if (dir == Direction2.Down) {
|
} else if (dir == Direction2.Down) {
|
||||||
return element.GetSiblings(e => e.GetOlderSibling() == element).FirstOrDefault();
|
return element.GetSiblings(e => e.CanBeSelected && e.GetOlderSibling(s => s.CanBeSelected) == element).FirstOrDefault();
|
||||||
}
|
}
|
||||||
return usualNext;
|
return usualNext;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue