The FwDeleteModal component is a pseudo component/modal hybrid because it opens a modal and internally uses the FwFullscreenModal
component, specifically
the confirm-choice
modal in the "sm" size. However, FwDeleteModal
requires even less
set up than that, thus it has the extremely niche case of opening a delete modal, and cannot really be expanded even to an "are you sure you want to archive?" modal. However, it
is very useful for what it is intended. How you use it is you follow the instructions for actions in Calling the Modal, but using
FwDeleteModal
instead of FwFullscreenModal
. The only properties you can pass in to either confirm-choice
or FwFullscreenModal
itself are those listed below. An example of how to use it would be:
When the user confirms the choice to delete, this component will automatically call destroyRecord
on that model, deleting it for you.
message
StringMessage displayed in the confirmation. If unset use the default (which looks at type property).
Default: "Are you sure you want to delete this {type}? It cannot be undone."
scrollTop
BooleanDetermines whether opening this modal caused the web browser to scroll to the top.
Default: false