Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.subscribe(event => {
// Prevent selecting text on shift click (click+drag to select will still work)
// Note that this is only called if the selection was empty initially (see above),
// so this only clears a selection caused by this click.
window.getSelection()!.removeAllRanges()
const position = locateTarget(event.target as HTMLElement, domFunctions)
let hash: string
if (
position &&
event.shiftKey &&
this.state.selectedPosition &&
this.state.selectedPosition.line !== undefined
) {
hash = toPositionOrRangeHash({
range: {
start: {
line: Math.min(this.state.selectedPosition.line, position.line),
},
end: {
line: Math.max(this.state.selectedPosition.line, position.line),
},
},
.subscribe(event => {
// Prevent selecting text on shift click (click+drag to select will still work)
// Note that this is only called if the selection was empty initially (see above),
// so this only clears a selection caused by this click.
window.getSelection().removeAllRanges()
const position = locateTarget(event.target as HTMLElement, domFunctions)
let hash: string
if (
position &&
event.shiftKey &&
this.state.selectedPosition &&
this.state.selectedPosition.line !== undefined
) {
hash = toPositionOrRangeHash({
range: {
start: {
line: Math.min(this.state.selectedPosition.line, position.line),
},
end: {
line: Math.max(this.state.selectedPosition.line, position.line),
},
},