diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ca5d10..4cab833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +- Fix browser input and action events on NativePHP versions that expose + `dispatchUiEvent()`, retaining the legacy dispatcher for older versions. + First public alpha, installable from `main`. Renders `Route::native()` screens as HTML in a browser from the same Blade source the mobile app ships. diff --git a/src/Protocol/WebScreenRunner.php b/src/Protocol/WebScreenRunner.php index 1ee7c91..f0ea8e7 100644 --- a/src/Protocol/WebScreenRunner.php +++ b/src/Protocol/WebScreenRunner.php @@ -340,7 +340,11 @@ public function update(Request $request) static::scoped($component, function () use ($event) { /** @var NativeComponent $this */ - $this->dispatch($event); + if (method_exists($this, 'dispatchUiEvent')) { + $this->dispatchUiEvent($event); + } else { + $this->dispatch($event); + } }); }