1
0
mirror of https://github.com/flarum/core.git synced 2025-08-02 14:37:49 +02:00

feat: allow multiple children to be passed to ConfirmDocumentUnload component (#3372)

This commit is contained in:
David Wheatley
2022-04-03 18:27:53 +01:00
committed by GitHub
parent a7dd0b2b61
commit 803f4cc792

View File

@@ -9,12 +9,6 @@ import Component from '../Component';
* *
* - `when` - a callback returning true when the browser should prompt for * - `when` - a callback returning true when the browser should prompt for
* confirmation before closing the window/tab * 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 { export default class ConfirmDocumentUnload extends Component {
handler() { handler() {
@@ -35,8 +29,6 @@ export default class ConfirmDocumentUnload extends Component {
} }
view(vnode) { view(vnode) {
// To avoid having to render another wrapping <div> here, we assume that return <>{vnode.children}</>;
// this component is only wrapped around a single element / component.
return vnode.children[0];
} }
} }