Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): Use SelectControl in Context Picker Modal #8688

Merged
merged 3 commits into from Jun 18, 2018

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Jun 7, 2018

Use new SelectControl in Context Picker Modal.
Fix hot keys not working after closing modal.

image

// Focus this to get hotkeys to keep working
let containerEl = document.querySelector('.main-container');
if (containerEl) {
containerEl.focus();
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 seems hacky, but not sure of a better solution.

Copy link
Member

@lynnagara lynnagara Jun 12, 2018

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem is when you close the modal, global hot keys stop working because the main body doesn't have focus. This is focusing an app container that's higher up in the tree. Ah after looking at it, .main-container is the parent so we may be able to just use a callback, for some reason I thought it was higher up in the tree.

@billyvg billyvg requested a review from lynnagara June 11, 2018 17:33
@billyvg billyvg force-pushed the fix/ui/use-select-context-modal-picker branch from 8deab44 to 135dfe5 Compare June 14, 2018 18:49
shouldHaveEmptyOrgSelector ? '' : latestContext.organization.slug
}
onChange={this.handleSelectOrganization}
<React.Fragment>
Copy link
Member

Choose a reason for hiding this comment

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

nit: don't need this

if (!this.projectSelect || this.state.loading) return;

// eslint-disable-next-line react/no-find-dom-node
ReactDOM.findDOMNode(this.projectSelect)
Copy link
Member Author

Choose a reason for hiding this comment

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

We should be able to use forwardRef to clean this up, but there's some issues with react-test-renderer serializing it.

Copy link
Member

Choose a reason for hiding this comment

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

@billyvg billyvg merged commit 122b6b8 into master Jun 18, 2018
@billyvg billyvg deleted the fix/ui/use-select-context-modal-picker branch June 18, 2018 19:57
billyvg added a commit that referenced this pull request Jul 19, 2018
* [ ] requires a PR in getsentry to be deployed together
* [x] kill the old Account Notifications page before proceeding.

Depends on:
* ~~#8688
* ~~#8723
* ~~getsentry/getsentry#1961
Chrissy pushed a commit that referenced this pull request Jul 20, 2018
* [ ] requires a PR in getsentry to be deployed together
* [x] kill the old Account Notifications page before proceeding.

Depends on:
* ~~#8688
* ~~#8723
* ~~https://github.com/getsentry/getsentry/pull/1961~~
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants