diff --git a/client/src/components/StreamField/blocks/BaseSequenceBlock.js b/client/src/components/StreamField/blocks/BaseSequenceBlock.js index 1da984b884..1615e302e6 100644 --- a/client/src/components/StreamField/blocks/BaseSequenceBlock.js +++ b/client/src/components/StreamField/blocks/BaseSequenceBlock.js @@ -156,8 +156,12 @@ export class BaseInsertionControl { this.index = newIndex; } - delete() { - $(this.element).hide().attr('aria-hidden', 'true'); + delete({ animate = false }) { + if (animate) { + $(this.element).slideUp().attr('aria-hidden', 'true'); + } else { + $(this.element).hide().attr('aria-hidden', 'true'); + } } } @@ -252,6 +256,7 @@ export class BaseSequenceBlock { this._onRequestInsert(newIndex, inserterOpts); }, strings: this.blockDef.meta.strings, + animate, } ); this.inserters.splice(index + 1, 0, inserter); @@ -281,7 +286,7 @@ export class BaseSequenceBlock { deleteBlock(index, opts) { const animate = opts && opts.animate; this.children[index].markDeleted({ animate }); - this.inserters[index].delete(); + this.inserters[index].delete({ animate }); this.children.splice(index, 1); this.inserters.splice(index, 1); diff --git a/client/src/components/StreamField/blocks/ListBlock.js b/client/src/components/StreamField/blocks/ListBlock.js index 5bea48a1bf..5f83684702 100644 --- a/client/src/components/StreamField/blocks/ListBlock.js +++ b/client/src/components/StreamField/blocks/ListBlock.js @@ -33,6 +33,7 @@ class InsertPosition extends BaseInsertionControl { constructor(placeholder, opts) { super(placeholder, opts); this.onRequestInsert = opts && opts.onRequestInsert; + const animate = opts && opts.animate; const button = $(`