Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-16152: always focus RHS on SELECT_POST #2987

Merged
merged 2 commits into from
Jun 26, 2019

Conversation

lieut-data
Copy link
Member

Summary

Ideally, we'd refactor focus to be an entity we can directly manipulate in a reducer, but that's a non-trivial refactoring. For now, I'm capturing the timestamp of the last SELECT_POST and using that within the component to decide when to ignore/effect a focus of the RHS textbox, given that we already track the blur timestamp.

Ticket Link

https://mattermost.atlassian.net/browse/MM-16152

Ideally, we'd refactor focus to be an entity we can directly manipulate in a reducer, but that's a non-trivial refactoring. For now, I'm capturing the timestamp of the last `SELECT_POST` and using that within the component to decide when to ignore/effect a focus of the RHS textbox, given that we already track the blur timestamp.
@lieut-data lieut-data added the 2: Dev Review Requires review by a core commiter label Jun 19, 2019
@@ -251,7 +256,7 @@ export default class CreateComment extends React.PureComponent {
this.scrollToBottom();
}

if (prevProps.rootId !== this.props.rootId) {
if (prevProps.rootId !== this.props.rootId || this.props.selectedPostFocussedAt > this.lastBlurAt) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the crux of the change.

@lieut-data lieut-data requested review from deanwhillier and removed request for mgdelacroix June 24, 2019 12:25
Copy link
Contributor

@deanwhillier deanwhillier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deanwhillier deanwhillier added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Jun 26, 2019
@lieut-data lieut-data merged commit b573d2d into master Jun 26, 2019
@lieut-data lieut-data deleted the mm-16152-always-focus-rhs-on-select-post branch June 26, 2019 14:44
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jul 16, 2019
@jgilliam17 jgilliam17 added the Tests/Done Release tests have been written label Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Done Release tests have been written
Projects
None yet
5 participants