@wordpress/components: Add isDismissible prop to <Modal> (#41800)

The isDismissible spelling has replaced isDismissable (with an "a"). The old
spelling has been left where it is to avoid breaking builds, however it has
been marked as deprecated in the JSDoc.

Added a test for the prop in wordpress__components-tests.tsx.
This commit is contained in:
Philip Jackson
2020-01-23 10:16:36 -08:00
committed by Ben Lichtman
parent 3fd6756917
commit fd56e4dd29
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -46,8 +46,15 @@ declare namespace Modal {
* If this property is set to false, the modal will not display a close
* icon and cannot be dismissed.
* @defaultValue true
* @deprecated Use isDismissible
*/
isDismissable?: boolean;
/**
* If this property is set to false, the modal will not display a close
* icon and cannot be dismissed.
* @defaultValue true
*/
isDismissible?: boolean;
/**
* If this property is added, it will an additional class name to the
* modal overlay div.
@@ -407,7 +407,7 @@ const kbshortcuts = {
//
// modal
//
<C.Modal title="This is my modal" onRequestClose={() => console.log('closing modal')}>
<C.Modal title="This is my modal" isDismissible={true} onRequestClose={() => console.log('closing modal')}>
<button onClick={() => console.log('clicked')}>My custom close button</button>
</C.Modal>;