-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- p5.strands
- WebGL
- DevOps, Build process, Unit testing
- Internationalization (i18n)
- Friendly Errors
- Other (specify if possible)
p5.js version
2.0.5
Web browser and version
Microsoft Edge Version 140.0.3485.94 (Official build) (64-bit), Firefox 143.0 (64-bit)
Operating system
Windows
Steps to reproduce this
Steps:
- Have any sketch with a
windowResized
method - Resize the window
- Zod prints this error on the console:
Zod error object {code: "custom", message: "Expected a UIEvent", …}
p5.js says: in windowResized().
Snippet:
p.windowResized = (event) => {
console.log({ event })
p.resizeCanvas(p.windowWidth, p.windowHeight)
}
The reason is that the event param is documented to be of type UIEvent
. However, in most browser, it will just be of type Event
.
See: https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event#event_type