- Added
props.dependenciesthat re-renders the alert whenever the provided Array ofdependenciesvalue changes. - Added new supported value of
'controlled'forprops.type. Ifprops.type === 'controlled'thenprops.onConfirmwill returnprops.dependencies. - Added support for using a function as your alert content/children, aka render props.
- Fixed deprecation warning from componentWillMount, componentWillUpdate and componentWillReceiveProps
- Fixed Sweetalert input validation message overflowing container.
- Added
props.focusCancelBtnthat focuses on the cancel button by default. - Added
props.reverseButtonsthat reverses the cancel and confirm button order. - Added
props.customActionsthat overrides the buttons in the alert message. In here it would be possible to create more buttons or add some custom behaviour. - Added support for custom show and hide animations with
props.openAnimandprops.closeAnim.
- Converted source code to typescript, added index.d.ts.
- Added
props.showCloseButtonfor displaying an X close button in the top right. - Added
props.closeButtonStylefor overriding the styles of the close button. - Added support for long content that requires scrolling, and moved ESC key listener to the overlay.
- Removed strict match on bootstrap button variation.
- Added
props.validationRegexfor validating input. default:/^.+$/
- Added
props.timeoutwhich calls onConfirm to close the alert automatically after a certain number of milliseconds. default:0
- Fixed auto-focus on confirm button
- Removed outline css from alert
- Updated examples to not show deprecated params
- Added
props.focusConfirmBtnto control whether you want to focus on the button automatically. default:true
- Added
props.closeOnClickOutsideto trigger onClose when clicking outside. default=true - Added
props.btnSizeto allow custom button size - Added
props.confirmBtnCssClassto allow custom class on confirm button - Added
props.cancelBtnCssClassto allow custom class on cancel button - Added
props.confirmBtnStyleto allow custom inline style on confirm button - Added
props.cancelBtnStyleto allow custom inline style on cancel button
- Added
prop-typesas peer dependency - Added
props.showConfirmto allow hiding the confirm button - Added
props.showto allow hiding the alert