Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Vadym Struts <[email protected]>
  • Loading branch information
vadimstruts committed Dec 10, 2024
1 parent 4e78f12 commit 064dbbf
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions components/cosmetic_filters/resources/data/element_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,26 +617,19 @@ const launchElementPicker = (root: ShadowRoot) => {
)

const svg = root.getElementById('picker-ui')!

svg.addEventListener(
'mousemove',
(event) => {
console.log('mouse move event')
if(window.matchMedia("(any-hover: none)").matches) {
console.log('mouse move event: no pointer devide detected')
return
}
console.log('mouse move event: !!! pointer devide detected')
if (isAndroid) {
return
}
if (!hasSelectedTarget) {
elementPickerHoverCoordsChanged(event.clientX, event.clientY)
}
event.stopPropagation()
},
true,
)
if(window.matchMedia("(pointer: fine)").matches &&
window.matchMedia("(hover: hover)").matches) {
svg.addEventListener(
'mousemove',
(event) => {
if (!hasSelectedTarget) {
elementPickerHoverCoordsChanged(event.clientX, event.clientY)
}
event.stopPropagation()
},
true,
)
}

const rulesTextArea: HTMLInputElement = root.querySelector(
'#rules-box > textarea',
Expand Down

0 comments on commit 064dbbf

Please sign in to comment.