Selection with keyboard. Internal changes. #1

Open
wants to merge 5 commits into
from

Projects

None yet

4 participants

@itrelease

Добавил возможность выделения через клавиатуру (можно продолжить выделение зажав клавишу Shift). Координаты конца выделения теперь находятся через Range объект, что на мой взгляд гораздо правильнее.

@ods
Contributor
ods commented Aug 3, 2011

The only difference in behavior I see is moving marker icon when selecting with arrow keys, but I doubt it's better than keeping marker icon near mouse pointer.

@itrelease

When selecting with keyboard the pageX and pageY of event would be a 0. That's why preferred to use Range#getClientRects to find position.

@shiberz
shiberz commented Aug 3, 2011

Currently marker appears when you release mouse button and doesn't move if you change selection with keyboard. If we apply your patch marker will move with end of selection, but you still need mouse to click it, so people have to move mouse to new marker position. I doubt that this behavior is userfriendly.

@ods
Contributor
ods commented Aug 3, 2011

Moving marker is more convenient when selecting long text in small srollable area. But I otherwise I'd prefer current behavior.

@shiberz
shiberz commented Aug 3, 2011

I think we could use Range#getClientRects to calculate marker position more correctly and to avoid the situation when non selected text overlapped with marker button.

@n0s
Contributor
n0s commented Aug 3, 2011

все правильно, pageX и pageY будут равны 0.
но я сомневаюсь, что выделение отдельных фрагментов в тексте удобно делать с клавиатуры.
в любом случае, мы чуть позже рассмотрим этот pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment