mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] TGUI 5.0 (#7700)
Co-authored-by: Selis <sirlionfur@hotmail.de> Co-authored-by: Selis <selis@xynolabs.com>
This commit is contained in:
@@ -65,19 +65,13 @@ it is used a lot in this framework.
|
||||
|
||||
**Event handlers.**
|
||||
Event handlers are callbacks that you can attack to various element to
|
||||
listen for browser events. Inferno supports camelcase (`onClick`) and
|
||||
lowercase (`onclick`) event names.
|
||||
listen for browser events. React supports camelcase (`onClick`) event names.
|
||||
|
||||
- Camel case names are what's called *synthetic* events, and are the
|
||||
**preferred way** of handling events in React, for efficiency and
|
||||
performance reasons. Please read
|
||||
[Inferno Event Handling](https://infernojs.org/docs/guides/event-handling)
|
||||
[React Event Handling](https://react.dev/learn/responding-to-events)
|
||||
to understand what this is about.
|
||||
- Lower case names are native browser events and should be used sparingly,
|
||||
for example when you need an explicit IE8 support. **DO NOT** use
|
||||
lowercase event handlers unless you really know what you are doing.
|
||||
- [Button](#button) component does not support the lowercase `onclick` event.
|
||||
Use the camel case `onClick` instead.
|
||||
|
||||
## `tgui/components`
|
||||
|
||||
@@ -746,7 +740,7 @@ Popper lets you position elements so that they don't go out of the bounds of the
|
||||
|
||||
**Props:**
|
||||
|
||||
- `popperContent: InfernoNode` - The content that will be put inside the popper.
|
||||
- `popperContent: ReactNode` - The content that will be put inside the popper.
|
||||
- `options?: { ... }` - An object of options to pass to `createPopper`. See [https://popper.js.org/docs/v2/constructors/#options], but the one you want most is `placement`. Valid placements are "bottom", "top", "left", and "right". You can affix "-start" and "-end" to achieve something like top left or top right respectively. You can also use "auto" (with an optional "-start" or "-end"), where a best fit will be chosen.
|
||||
- `additionalStyles: { ... }` - A map of CSS styles to add to the element that will contain the popper.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user