mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-15 00:40:56 -05:00
ad7abee39a
* Remove extra padding for off-screen review panel entries * use document.activeElement * cleanup editor padding cases * using isSelectionWithinOp * fix formatting * focusHandler function * 1px border for focused entry * use constants * using isFirstEntry GitOrigin-RevId: 4509f803b6cb907b40f1745a6fc7f3b1edfe145c
10 lines
337 B
TypeScript
10 lines
337 B
TypeScript
import { AnyOperation } from '../../../../../types/change'
|
|
import { SelectionRange } from '@codemirror/state'
|
|
import { visibleTextLength } from '@/utils/operations'
|
|
|
|
export const isSelectionWithinOp = (
|
|
op: AnyOperation,
|
|
range: SelectionRange
|
|
): boolean => {
|
|
return range.to >= op.p && range.from <= op.p + visibleTextLength(op)
|
|
}
|