|
|
@ -57,7 +57,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const { top } = target.getBoundingClientRect(); |
|
|
|
const { top } = target.getBoundingClientRect(); |
|
|
|
if (this.state.open && this.activeElement) { |
|
|
|
if (this.state.open && this.activeElement) { |
|
|
|
this.activeElement.focus(); |
|
|
|
this.activeElement.focus({ preventScroll: true }); |
|
|
|
} |
|
|
|
} |
|
|
|
this.setState({ placement: top * 2 < innerHeight ? 'bottom' : 'top' }); |
|
|
|
this.setState({ placement: top * 2 < innerHeight ? 'bottom' : 'top' }); |
|
|
|
this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' }); |
|
|
|
this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' }); |
|
|
@ -100,7 +100,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent { |
|
|
|
|
|
|
|
|
|
|
|
handleClose = () => { |
|
|
|
handleClose = () => { |
|
|
|
if (this.state.open && this.activeElement) { |
|
|
|
if (this.state.open && this.activeElement) { |
|
|
|
this.activeElement.focus(); |
|
|
|
this.activeElement.focus({ preventScroll: true }); |
|
|
|
} |
|
|
|
} |
|
|
|
this.setState({ open: false }); |
|
|
|
this.setState({ open: false }); |
|
|
|
} |
|
|
|
} |
|
|
|