Skip to content

Commit 1c224fe

Browse files
committed
hide scroll bar when modal shows up
1 parent 4299bae commit 1c224fe

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

browser/lib/modal.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ModalBase extends React.Component {
1515

1616
close () {
1717
if (modalBase != null) modalBase.setState({component: null, componentProps: null, isHidden: true})
18+
document.body.setAttribute('data-modal', 'close')
1819

1920
remote.getCurrentWebContents().send('list-focus')
2021
}
@@ -37,6 +38,8 @@ let modalBase = ReactDOM.render(<ModalBase/>, el)
3738

3839
export function openModal (component, props) {
3940
if (modalBase == null) { return }
41+
42+
document.body.setAttribute('data-modal', 'open')
4043
modalBase.setState({component: component, componentProps: props, isHidden: false})
4144
}
4245

browser/styles/main/index.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ body
2323
font-size fontSize
2424
font-weight 400
2525

26+
body[data-modal="open"]
27+
#content *
28+
overflow hidden !important
29+
2630
button, input, select, textarea
2731
font-family DEFAULT_FONTS
2832

0 commit comments

Comments
 (0)