Skip to content

Commit

Permalink
DropDown buttons fix (tgstation#81808)
Browse files Browse the repository at this point in the history
## About The Pull Request

Fixes dropdown menu buttons. Postfix increment and decrement were
preventing buttons from working properly, causing menu values to not
change, or to change incorrectly.
## Why It's Good For The Game

It's not just good IT'S AHUENNO AND PIZDATO CUZ IT'S MAKES USING THIS
BEAUTIFUL BUTTONS REAL
<details>
<summary>Screenshot. The left and right buttons I'm talking
about</summary>

![image
1](https://github.com/tgstation/tgstation/assets/114810807/e683b324-ef63-43f3-ad66-1ad9ed518d27)
</details>

## Changelog

🆑
fix: fixed a non-functional buttons of a drop-down menu.
/:cl:
  • Loading branch information
JlereHda3oHbl1984 authored Mar 5, 2024
1 parent 8afd896 commit 76cd19e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tgui/packages/tgui/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export function Dropdown(props: Props) {

let newIndex = selectedIndex;
if (direction === 'next') {
newIndex = selectedIndex === endIndex ? startIndex : selectedIndex++;
newIndex = selectedIndex === endIndex ? startIndex : ++selectedIndex;
} else {
newIndex = selectedIndex === startIndex ? endIndex : selectedIndex--;
newIndex = selectedIndex === startIndex ? endIndex : --selectedIndex;
}

onSelected?.(getOptionValue(options[newIndex]));
Expand Down

0 comments on commit 76cd19e

Please sign in to comment.