AJAX on main thread, fix double-push in click delegation
- AJAX requests (SX-Request: true) now render on main thread instead of queueing behind slow full-page renders in worker pool - Remove pushState from click handler — handle-history does it after swap succeeds, preventing double-push that triggered popstate handler Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -464,10 +464,8 @@
|
||||
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
||||
e.preventDefault();
|
||||
var url = el.getAttribute("href") || el.getAttribute("sx-get");
|
||||
// Push URL first (execute-request doesn't handle URL updates)
|
||||
if (el.getAttribute("sx-push-url")) {
|
||||
history.pushState({}, "", url);
|
||||
}
|
||||
// Don't push URL here — execute-request's handle-history does it.
|
||||
// Double-push causes popstate handler to clobber the SX swap.
|
||||
// Store the element reference for SX to pick up
|
||||
window.__sxClickEl = el;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user