From 803f4cc792a1cd73e6fdb829d8f20e9ccd032722 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sun, 3 Apr 2022 18:27:53 +0100 Subject: [PATCH] feat: allow multiple children to be passed to ConfirmDocumentUnload component (#3372) --- .../js/src/common/components/ConfirmDocumentUnload.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/framework/core/js/src/common/components/ConfirmDocumentUnload.js b/framework/core/js/src/common/components/ConfirmDocumentUnload.js index 597575e32..063fb7974 100644 --- a/framework/core/js/src/common/components/ConfirmDocumentUnload.js +++ b/framework/core/js/src/common/components/ConfirmDocumentUnload.js @@ -9,12 +9,6 @@ import Component from '../Component'; * * - `when` - a callback returning true when the browser should prompt for * confirmation before closing the window/tab - * - * ### Children - * - * NOTE: Only the first child will be rendered. (Use this component to wrap - * another component / DOM element.) - * */ export default class ConfirmDocumentUnload extends Component { handler() { @@ -35,8 +29,6 @@ export default class ConfirmDocumentUnload extends Component { } view(vnode) { - // To avoid having to render another wrapping
here, we assume that - // this component is only wrapped around a single element / component. - return vnode.children[0]; + return <>{vnode.children}; } }