Merge pull request #7954 from KDSBrowne/001-chat-input-focus

Fix chat input loss of focus
This commit is contained in:
Anton Georgiev 2019-08-20 13:50:45 -04:00 committed by GitHub
commit 56a8302cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -94,9 +94,11 @@ class UserParticipants extends Component {
return !isPropsEqual || !isStateEqual;
}
componentDidUpdate() {
componentDidUpdate(prevProps, prevState) {
const { selectedUser } = this.state;
if (selectedUser === prevState.selectedUser) return;
if (selectedUser) {
const { firstChild } = selectedUser;
if (firstChild) firstChild.focus();

View File

@ -154,7 +154,6 @@ class UserDropdown extends PureComponent {
componentDidUpdate() {
const { dropdownVisible } = this.props;
if (!dropdownVisible) document.activeElement.blur();
this.checkDropdownDirection();
}