Commit Graph
21 Commits
Author SHA1 Message Date
79a2f023e7 Add the onvisible event handler to Element (#2911)
* Add the `onvisible` event using the IntersectionObserver

* Add a visible example

This example is based on https://codepen.io/ryanfinni/pen/VwZeGxN

* Remove web-sys CustomEvent feature for html package

* update js bindings and hash

* Use dioxus doc instead of lorem ipsum

* Fix clippy warning

* Add get_target method to the event data

* Make `get_time` return an Instant instead of a f64

* fix merge conflicts, compilinga

* remove target

* small nits

* serialzie as time_ms

* fix timing, works on desktop

* remove latent nits, fix hash

* box size clippy

* fix browserlist cargo.lock

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-12-02 13:51:27 -08:00
ASR-ASUandEvan Almloff 2f49a89638 Add the onresize event handler to Element (#2479)
* Add the capability to handle resize event for web target

* Add the capability to handle resize event for desktop target

* Return all the sizes, not just the first one

* Fix conversion from platform to generic ResizedData for liveview

* Update the generated interpreter js code base

* Fix clippy warnings

* Fix inconsistent use of block_size and inline_size

* Rename `onresized` event to `onresize`

* Remove the the special-casing logic from the binding logic

* Propagating the resize events using CustomEvent

* Fix case convention in core ts

* revert changes to unified bindings

* Cleanup as suggested

* add a resize example

* Fix desktop resize events

* remove tracing from resize example

* use the raw resize entry so we can downcast on web

* remove unused ResizeEventDetail

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-08-15 01:23:49 +00:00
Wesley McCannandEvan Almloff 5bdb147afd Handle deserialize errors without panic (#2664)
* Handle deserialize errors rather than panic

* don't clone event data for deserialization in debug or release mode

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-07-22 12:20:15 -05:00
Jonathan Kelley 81f38a0bc5 cfg out globalhotkey 2024-03-06 16:42:45 -08:00
Jonathan Kelley 199173a409 fix navigating when files are dropped 2024-03-01 23:37:46 -08:00
Evan Almloff 0ab7a02777 fix clippy 2023-09-05 21:30:20 -05:00
Evan Almloff bd38cddc9f fix dioxus core event tests 2023-09-04 19:17:43 -05:00
Evan Almloff df222c121a port examples to new events 2023-09-01 15:38:55 -05:00
Evan Almloff 8ba1c05a93 fix desktop events 2023-08-28 16:37:19 -05:00
Evan Almloff 93cbfd0dbc derive more traits for serialized types 2023-08-28 12:35:43 -05:00
Evan Almloff 299b123446 trait based event system 2023-08-25 17:02:48 -05:00
ealmloff cf9ed74303 Merge branch 'master' into fix-onload-event 2023-06-19 08:16:40 -05:00
Evan Almloff 043aae1689 fix the onload event 2023-05-08 17:49:28 -05:00
Evan Almloff fa9f0d0f6c Generalize Query system for use in use_eval and node querys 2023-03-23 15:19:00 -05:00
Evan Almloff 7636c046fa implement on mounted for desktop 2023-03-20 16:10:34 -05:00
Jonathan Kelley 50faa7dd08 feat: add proper event type 2022-12-19 14:14:01 -08:00
Jon Kelley 5ac9b595ea Revert "fix: liveview interpreter using new templates" 2022-12-16 14:20:05 -08:00
Jonathan Kelley 01fa68645f fix: liveview test 2022-12-15 20:42:01 -08:00
Jonathan Kelley 7790d2c065 chore: simplify liveview abstraction 2022-12-15 18:46:59 -08:00
Jonathan Kelley 06e8e096bb feat: more fixes to liveview 2022-12-15 14:25:23 -08:00
Jonathan Kelley e256fe1079 wip: add html event type 2022-12-14 19:07:33 -08:00