Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/LiveComponent/assets/dist/live_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ var HookManager_default = class {
}
};

// ../../../node_modules/.pnpm/[email protected]/node_modules/idiomorph/dist/idiomorph.esm.js
var Idiomorph = function() {
// ../../../node_modules/idiomorph/dist/idiomorph.esm.js
var Idiomorph = (function() {
"use strict";
let EMPTY_SET = /* @__PURE__ */ new Set();
let defaults = {
Expand Down Expand Up @@ -1093,7 +1093,7 @@ var Idiomorph = function() {
morph,
defaults
};
}();
})();

// src/normalize_attributes_for_comparison.ts
function normalizeAttributesForComparison(element) {
Expand Down Expand Up @@ -2045,6 +2045,7 @@ var Component = class {
if (!controls.shouldRender) {
return;
}
this.hooks.triggerHook("loading.state:finished", this.element);
if (backendResponse.response.headers.get("Location")) {
if (this.isTurboEnabled()) {
Turbo.visit(backendResponse.response.headers.get("Location"));
Expand All @@ -2053,7 +2054,6 @@ var Component = class {
}
return;
}
this.hooks.triggerHook("loading.state:finished", this.element);
const modifiedModelValues = {};
Object.keys(this.valueStore.getDirtyProps()).forEach((modelName) => {
modifiedModelValues[modelName] = this.valueStore.get(modelName);
Expand Down
10 changes: 5 additions & 5 deletions src/LiveComponent/assets/src/Component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ export default class Component {
return;
}

// remove the loading behavior now so that when we morphdom
// "diffs" the elements, any loading differences will not cause
// elements to appear different unnecessarily
this.hooks.triggerHook('loading.state:finished', this.element);

if (backendResponse.response.headers.get('Location')) {
// action returned a redirect
if (this.isTurboEnabled()) {
Expand All @@ -370,11 +375,6 @@ export default class Component {
return;
}

// remove the loading behavior now so that when we morphdom
// "diffs" the elements, any loading differences will not cause
// elements to appear different unnecessarily
this.hooks.triggerHook('loading.state:finished', this.element);

/**
* For any models modified since the last request started, grab
* their value now: we will re-set them after the new data from
Expand Down