Skip to content

Commit

Permalink
Dropdowns v2 (tgstation#75164)
Browse files Browse the repository at this point in the history
## About The Pull Request

Complete rewrite of dropdowns to use popper elements that are injected
at the body level.
This means they are now horribly overcomplicated and also suck a lot
less

![2023-05-04_06-57-12](https://user-images.githubusercontent.com/5194834/236229806-2f676e7b-d6c5-427a-af2f-520d883be790.gif)
Also ported `Icon` to typescript for a reason that didn't end up making
it in the PR

## Why It's Good For The Game

![image](https://user-images.githubusercontent.com/5194834/236226086-35ec2009-e9a9-404b-9b52-3ab8de0a0ae6.png)

![image](https://user-images.githubusercontent.com/5194834/236226573-880c0380-0f70-41c7-90c6-d51ba4238561.png)

## Changelog
:cl:
add: good tgui dropdowns
del: tgui dropdown suck
qol: tgui dropdowns suck less
balance: buffed tgui dropdowns
/:cl:
  • Loading branch information
actioninja authored May 7, 2023
1 parent edd5ebe commit b8fc54a
Show file tree
Hide file tree
Showing 11 changed files with 345 additions and 198 deletions.
11 changes: 5 additions & 6 deletions tgui/docs/component-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,14 @@ and displays selected entry.

- See inherited props: [Box](#box)
- See inherited props: [Icon](#icon)
- `options: string[]` - An array of strings which will be displayed in the
dropdown when open
- `selected: string` - Currently selected entry
- `width: number` - Width of dropdown button and resulting menu
- `options: string[] | DropdownEntry[]` - An array of strings which will be displayed in the
dropdown when open. See Dropdown.tsx for more adcanced usage with DropdownEntry
- `selected: any` - Currently selected entry
- `width: string` - Width of dropdown button and resulting menu; css width value
- `over: boolean` - Dropdown renders over instead of below
- `color: string` - Color of dropdown button
- `nochevron: boolean` - Whether or not the arrow on the right hand side of the dropdown button is visible
- `noscroll: boolean` - Whether or not the dropdown menu should have a scroll bar
- `displayText: string` - Text to always display in place of the selected text
- `displayText: string | number | InfernoNode` - Text to always display in place of the selected text
- `onClick: (e) => void` - Called when dropdown button is clicked
- `onSelected: (value) => void` - Called when a value is picked from the list, `value` is the value that was picked

Expand Down
161 changes: 0 additions & 161 deletions tgui/packages/tgui/components/Dropdown.js

This file was deleted.

Loading

0 comments on commit b8fc54a

Please sign in to comment.