-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3373 Fix editor text selection over Lynx insight #3362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3362 +/- ##
==========================================
+ Coverage 82.21% 82.23% +0.01%
==========================================
Files 608 608
Lines 36199 36232 +33
Branches 5911 5943 +32
==========================================
+ Hits 29761 29795 +34
+ Misses 5579 5564 -15
- Partials 859 873 +14 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @siltomato)
src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text.component.ts
line 534 at r1 (raw file):
.subscribe(event => { this.isShiftDown = event.shiftKey; });
If you use shift to select multiple characters, keep shift down, then click the taskbar (or anything other than the web browser), release shift, then click inside another verse, the selected verse doesn't get updated correctly.
One way to fix that would be to updated isShiftDown on mousedown, i.e.:
fromEvent<MouseEvent>(document, 'mousedown')
.pipe(quietTakeUntilDestroyed(this.destroyRef))
.subscribe(event => {
this.isShiftDown = event.shiftKey;
});
Code quote:
fromEvent<KeyboardEvent>(document, 'keydown')
.pipe(quietTakeUntilDestroyed(this.destroyRef))
.subscribe(event => {
this.isShiftDown = event.shiftKey;
});
37029c7
to
ffdcc0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pmachapman)
src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text.component.ts
line 534 at r1 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
If you use shift to select multiple characters, keep shift down, then click the taskbar (or anything other than the web browser), release shift, then click inside another verse, the selected verse doesn't get updated correctly.
One way to fix that would be to updated isShiftDown on mousedown, i.e.:
fromEvent<MouseEvent>(document, 'mousedown') .pipe(quietTakeUntilDestroyed(this.destroyRef)) .subscribe(event => { this.isShiftDown = event.shiftKey; });
Ah, nice catch. I opted for window 'blur', as it seems to handle this case in addition to the case where the window focus changes without a mouse event (like Alt + Tab).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @siltomato)
ffdcc0b
to
42484de
Compare
This PR fixes an issue where selecting across text with a lynx insight was breaking the selection. The problematic case was selecting backwards with keyboard selection (shift + arrow keys).
Additionally, in order to fix cursor lag, the editor will switch to the system cursor when the user presses and holds any key that would cause cursor movement. The custom local Quill cursor will be switched back when keys released.
This change is