Skip to content

Commit

Permalink
Merge pull request #73 from mrxz/vanilla-event-names
Browse files Browse the repository at this point in the history
fix: use lowercase eventnames in vanilla example and docs
  • Loading branch information
bbohlender authored Jun 6, 2024
2 parents 7bbbc13 + f4848a6 commit 429e6d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/getting-started/vanilla.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ The vanilla version of uikit allows to build user interfaces with plain Three.js
The vanilla version of uikit (`@pmndrs/uikit`) is decoupled from react. Therefore features such providing defaults via context is not available. Furthermore, no event system is available out of the box. For interactivity, such as hover effects, developers have to attach their own event system by emitting pointer events to the UI elements:

```js
uiElement.dispatchEvent({ type: 'pointerOver', target: uiElement, nativeEvent: { pointerId: 1 } })
uiElement.dispatchEvent({ type: 'pointerover', target: uiElement, nativeEvent: { pointerId: 1 } })
```

Aside from interacitivty and contexts, every feature is available.
Aside from interactivity and contexts, every feature is available.

## Building a user interface with `@pmndrs/uikit`

Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const x = new Container({
justifyContent: 'center',
onSizeChange: console.log,
})
setTimeout(() => x.dispatchEvent({ type: 'pointerOver', target: x, nativeEvent: { pointerId: 1 } } as any), 0)
setTimeout(() => x.dispatchEvent({ type: 'pointerover', target: x, nativeEvent: { pointerId: 1 } } as any), 0)
const img = new Image({
src: 'https://picsum.photos/300/300',
borderRadius: 1000,
Expand Down

0 comments on commit 429e6d4

Please sign in to comment.