Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 443582d

Browse files
committed
🎨 FilePatchView - put click handlers on outer div
1 parent 4cd66f1 commit 443582d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/views/file-patch-view.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ export default class FilePatchView {
9999
render () {
100100
let stageButtonLabelPrefix = this.props.stagingStatus === 'unstaged' ? 'Stage' : 'Unstage'
101101
return (
102-
<div className='git-FilePatchView' tabIndex='-1'>{this.props.hunks.map((hunk) => {
103-
const isSelected = this.list.getSelectedKeys().has(hunk)
104-
const selectedLines = isSelected ? this.list.getSelectedItems() : EMPTY_SET
105-
return (
106-
<div onmouseup={() => this.disableSelections()}
107-
onmousedown={() => this.enableSelections()}>
102+
<div className='git-FilePatchView' tabIndex='-1'
103+
onmouseup={() => this.disableSelections()}
104+
onmousedown={() => this.enableSelections()}>
105+
{this.props.hunks.map((hunk) => {
106+
const isSelected = this.list.getSelectedKeys().has(hunk)
107+
const selectedLines = isSelected ? this.list.getSelectedItems() : EMPTY_SET
108+
return (
108109
<HunkView
109110
hunk={hunk}
110111
isSelected={isSelected}
@@ -115,9 +116,8 @@ export default class FilePatchView {
115116
stageButtonLabelPrefix={stageButtonLabelPrefix}
116117
selectionEnabled={this.selectionEnabled}
117118
registerView={this.props.registerHunkView} />
118-
</div>
119-
)
120-
})}
119+
)
120+
})}
121121
</div>
122122
)
123123
}

0 commit comments

Comments
 (0)