Reference Source
import ConfirmDocumentUnload from 'flarum/components/ConfirmDocumentUnload'
public class | source

ConfirmDocumentUnload

Extends:

src/common/Component.js~Component → ConfirmDocumentUnload

The ConfirmDocumentUnload component can be used to register a global event handler that prevents closing the browser window/tab based on the return value of a given callback prop.

Attrs

  • 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.)

Member Summary

Public Members
public

Method Summary

Public Methods
public

handler(): *

public

oncreate(vnode: *)

public
public

view(vnode: *): *

Public Members

public boundHandler: * source

Public Methods

public handler(): * source

Return:

*

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public onremove() source

public view(vnode: *): * source

Params:

NameTypeAttributeDescription
vnode *

Return:

*