Skip to content
Draft
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
11 changes: 10 additions & 1 deletion resources/js/components/fieldtypes/GroupFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ export default {
},

toggleCollapsed() {
this.isCollapsed = !this.isCollapsed;
if (! this.isCollapsed) {
this.isCollapsed = true;
return;
}

// Expanding: defer the reveal by one frame so the nested Bard editor is
// shown after the click, not during it. Revealing a ProseMirror editor in
// the same trusted click as a pending rich-text copy crashes the tab on
// Chrome/Edge >= 148 (a renderer CFI abort). See statamic/cms#14946.
requestAnimationFrame(() => (this.isCollapsed = false));
},

toggleFullScreen() {
Expand Down
27 changes: 18 additions & 9 deletions resources/js/components/fieldtypes/bard/BardFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -633,23 +633,32 @@ export default {
},

expandSet(id) {
if (this.config.collapse === 'accordion') {
this.collapsed = Object.keys(this.meta.existing).filter((v) => v !== id);
return;
}
// Defer the reveal by one frame so the nested Bard editor is shown
// after the click, not during it. Revealing a ProseMirror editor in
// the same trusted click as a pending rich-text copy crashes the tab
// on Chrome/Edge >= 148 (a renderer CFI abort). See statamic/cms#14946.
requestAnimationFrame(() => {
if (this.config.collapse === 'accordion') {
this.collapsed = Object.keys(this.meta.existing).filter((v) => v !== id);
return;
}

if (this.collapsed.includes(id)) {
var index = this.collapsed.indexOf(id);
this.collapsed.splice(index, 1);
}
if (this.collapsed.includes(id)) {
var index = this.collapsed.indexOf(id);
this.collapsed.splice(index, 1);
}
});
},

collapseAll() {
this.collapsed = Object.keys(this.meta.existing);
},

expandAll() {
this.collapsed = [];
// Defer the reveal one frame — same reason as expandSet() (statamic/cms#14946).
requestAnimationFrame(() => {
this.collapsed = [];
});
},

toggleCollapseSets() {
Expand Down
27 changes: 18 additions & 9 deletions resources/js/components/fieldtypes/replicator/Replicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,23 +313,32 @@ export default {
},

expandSet(id) {
if (this.config.collapse === 'accordion') {
this.collapsed = this.value.map((v) => v._id).filter((v) => v !== id);
return;
}
// Defer the reveal by one frame so a nested Bard editor is shown
// after the click, not during it. Revealing a ProseMirror editor in
// the same trusted click as a pending rich-text copy crashes the tab
// on Chrome/Edge >= 148 (a renderer CFI abort). See statamic/cms#14946.
requestAnimationFrame(() => {
if (this.config.collapse === 'accordion') {
this.collapsed = this.value.map((v) => v._id).filter((v) => v !== id);
return;
}

if (this.collapsed.includes(id)) {
var index = this.collapsed.indexOf(id);
this.collapsed.splice(index, 1);
}
if (this.collapsed.includes(id)) {
var index = this.collapsed.indexOf(id);
this.collapsed.splice(index, 1);
}
});
},

collapseAll() {
this.collapsed = this.value.map((v) => v._id);
},

expandAll() {
this.collapsed = [];
// Defer the reveal one frame — same reason as expandSet() (statamic/cms#14946).
requestAnimationFrame(() => {
this.collapsed = [];
});
},

toggleFullscreen() {
Expand Down
Loading