mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
feat: allow multiple children to be passed to ConfirmDocumentUnload component (#3372)
This commit is contained in:
@@ -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 <div> here, we assume that
|
||||
// this component is only wrapped around a single element / component.
|
||||
return vnode.children[0];
|
||||
return <>{vnode.children}</>;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user