mirror of https://github.com/Sonarr/Sonarr
New: Don't close interactive search with background click
This commit is contained in:
parent
a9b8ec3505
commit
37e1c4f2eb
|
@ -6,6 +6,24 @@ import EpisodeDetailsModalContentConnector from './EpisodeDetailsModalContentCon
|
||||||
|
|
||||||
class EpisodeDetailsModal extends Component {
|
class EpisodeDetailsModal extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
constructor(props, context) {
|
||||||
|
super(props, context);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
closeOnBackgroundClick: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Listeners
|
||||||
|
|
||||||
|
onTabChange = (isSearch) => {
|
||||||
|
this.setState({ closeOnBackgroundClick: !isSearch });
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Render
|
// Render
|
||||||
|
|
||||||
|
@ -20,10 +38,12 @@ class EpisodeDetailsModal extends Component {
|
||||||
<Modal
|
<Modal
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
size={sizes.EXTRA_LARGE}
|
size={sizes.EXTRA_LARGE}
|
||||||
|
closeOnBackgroundClick={this.state.closeOnBackgroundClick}
|
||||||
onModalClose={onModalClose}
|
onModalClose={onModalClose}
|
||||||
>
|
>
|
||||||
<EpisodeDetailsModalContentConnector
|
<EpisodeDetailsModalContentConnector
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
|
onTabChange={this.onTabChange}
|
||||||
onModalClose={onModalClose}
|
onModalClose={onModalClose}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -37,7 +37,9 @@ class EpisodeDetailsModalContent extends Component {
|
||||||
// Listeners
|
// Listeners
|
||||||
|
|
||||||
onTabSelect = (index, lastIndex) => {
|
onTabSelect = (index, lastIndex) => {
|
||||||
this.setState({ selectedTab: tabs[index] });
|
const selectedTab = tabs[index];
|
||||||
|
this.props.onTabChange(selectedTab === 'search');
|
||||||
|
this.setState({ selectedTab });
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -206,6 +208,7 @@ EpisodeDetailsModalContent.propTypes = {
|
||||||
selectedTab: PropTypes.string.isRequired,
|
selectedTab: PropTypes.string.isRequired,
|
||||||
startInteractiveSearch: PropTypes.bool.isRequired,
|
startInteractiveSearch: PropTypes.bool.isRequired,
|
||||||
onMonitorEpisodePress: PropTypes.func.isRequired,
|
onMonitorEpisodePress: PropTypes.func.isRequired,
|
||||||
|
onTabChange: PropTypes.func.isRequired,
|
||||||
onModalClose: PropTypes.func.isRequired
|
onModalClose: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue