### Summary: When conditional render is used - react modal restores focus on unmount without triggering `onFocus` event handler on target input. ### Steps to reproduce: 1. Add `<Modal />` 2. Focus some input 3. Mount/unmount the modal 4. Focus restored w/o triggering `onFocus` event handler on the input ### Expected behavior: Input's `onFocus` event handler is triggered on focus restore. ### Link to example of issue: React16 and v3: https://codesandbox.io/s/6y6nx2np4k ### Additional notes: - It works in case of using `isOpen` attribute instead of conditional rendering - It works with v2 and React15 in case `closeTimeoutMS` is set (I think #530 issue prevents using this workaround) - It works in case restore focus in timeout In case of using for example `draft-js` as an input, this bug becomes a cause of the really strange behavior after focus restore.
Summary:
When conditional render is used - react modal restores focus on unmount without triggering
onFocusevent handler on target input.Steps to reproduce:
<Modal />onFocusevent handler on the inputExpected behavior:
Input's
onFocusevent handler is triggered on focus restore.Link to example of issue:
React16 and v3: https://codesandbox.io/s/6y6nx2np4k
Additional notes:
isOpenattribute instead of conditional renderingcloseTimeoutMSis set (I think v3 don't respectcloseTimeoutMSon unmount anymore #530 issue prevents using this workaround)In case of using for example
draft-jsas an input, this bug becomes a cause of the really strange behavior after focus restore.