mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
@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:
committed by
Ben Lichtman
parent
3fd6756917
commit
fd56e4dd29
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user