fun-modal-controller

Controls the position and dismissal of modal dialogs. This component has no opinions about the actual appearance of the dialog, but is designed to work together with the fun-modal component.

For a fully ‘modal’ dialog, where the user is forced to use one of the buttons in the modal to dismiss it, set closeOnClickOutside and closeOnEscape to false. You can also set closeButton to false on the fun-modal component, if you are using that.

See the Modal guidelines for usage of modals.

Examples

Specifications

Properties

PropertyAttributeRequiredDescriptionTypeDefault
closeOnClickOutsideclose-on-click-outsidefalseShould the modal close when the user clicks outside itbooleantrue
closeOnEscapeclose-on-escapefalseShould the modal close when the user presses ‘Escape’booleantrue
openopentrueIs the modal openboolean
portalportalfalseExperimental: If set, look for a dom element with this ID to render the modal inside. If not set or doesn’t exist, render inline.string
submitOnEntersubmit-on-enterfalseShould the modal be submitted when the user presses command+enterbooleantrue

Events

NameDescription
funDismissEmitted when the modal is dismissed.
funOpenEmitted after the modal is opened. A good place to put code
to focus on something in the modal.
funSubmitEmitted when the modal is submitted using command+enter.

Dependencies

Depends on

This documentation page generated from the source at fun-modal-controller.tsx

Search Gunnel

Powered byAlgolia