Prevent desktop reloads at the wry level (#4422)

* Prevent desktop reloads at the wry level

* add a test

* only allow one navigation
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-07-15 14:26:52 -07:00
1 parent 393246b923
commit 0d2e1f4051
7 files changed
+124 -20

No files matched your search

-9
View File
@@ -278,15 +278,6 @@ export class NativeInterpreter extends JSChannel_ {
bubbles,
};
// This should:
// - prevent form submissions from navigating
// - prevent anchor tags from navigating
// - prevent buttons from submitting forms
// - let the virtualdom attempt to prevent the event
if (event.type === "submit") {
event.preventDefault();
}
// liveview does not have synchronous event handling, so we need to send the event to the host
if (this.liveview) {
// Okay, so the user might've requested some files to be read