Browse Source

Disable ModalWrap focus grab if lastFocus is inside it already

gre-patch-1
Juan Cortes Ross 6 years ago
parent
commit
33e5b4df6e
No known key found for this signature in database GPG Key ID: 34A99C03E9455EB8
  1. 3
      src/components/base/Modal/index.js

3
src/components/base/Modal/index.js

@ -186,8 +186,7 @@ export class Modal extends Component<Props> {
focusWrapper = () => {
// Forced to use findDOMNode here, because innerRef is giving a proxied component
const domWrapper = findDOMNode(this._wrapper) // eslint-disable-line react/no-find-dom-node
if (domWrapper instanceof HTMLDivElement) {
if (domWrapper instanceof HTMLDivElement && !domWrapper.contains(this._lastFocusedElement)) {
domWrapper.focus()
}
}

Loading…
Cancel
Save