Skip to content

Commit

Permalink
Merge pull request #535 from xintaoLi/staging
Browse files Browse the repository at this point in the history
fix: shift + click stop user-select
  • Loading branch information
xintaoLi authored May 13, 2024
2 parents 4f0c229 + a35efcd commit 722fedf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/components/table/table-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ const forced = {
event.stopImmediatePropagation()

if (disabled) return
const isShift = store.table.shiftMulti.isShift()
if (isShift) {
store.table.$el.style.setProperty('user-select', 'none')
}

const result = await beforeChange()
result !== false && store.commit('rowSelectedChanged', row, $index)
Expand Down
3 changes: 0 additions & 3 deletions src/components/table/table-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,6 @@ class TableStore {
states.selection.push(child)
}
})
setTimeout(() => {
this.table.$el.style.setProperty('user-select', 'inherit')
})
}

if (changed) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/table/use-shift-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ export default (props) => {
const handleKeyDown = (e) => {
if (e.key === 'Shift') {
isShiftKeyDown = true
document.body.style.userSelect = 'none'
}
}

const handleKeyUp = (e) => {
if (e.key === 'Shift') {
isShiftKeyDown = false
document.body.style.userSelect = ''
clearStore()
}
}
Expand Down

0 comments on commit 722fedf

Please sign in to comment.