Skip to content

Commit

Permalink
Fix user-select
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed Oct 2, 2022
1 parent 7870196 commit f6741ff
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/components/selection/handle.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,18 @@ export class Handle extends HTMLElement {
const initialTransform = new DOMMatrix(initialStyle.transform)

const originalElTransition = sourceEl.style.transition
sourceEl.style.transition = 'none'

const originalDocumentCursor = document.body.style.cursor
const originalDocumentUserSelect = document.body.style.userSelect
const newCursor = getComputedStyle(this).getPropertyValue('--cursor')
sourceEl.style.transition = 'none'
document.body.style.cursor = getComputedStyle(this).getPropertyValue('--cursor')
document.body.style.userSelect = 'none'

document.addEventListener('pointermove', on_element_resize_move)

function on_element_resize_move(e) {
e.preventDefault()
e.stopPropagation()

document.body.style.cursor = newCursor

const newX = clamp(0, e.clientX, document.documentElement.clientWidth)
const newY = clamp(0, e.clientY, document.documentElement.clientHeight)

Expand Down

0 comments on commit f6741ff

Please sign in to comment.