-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3276 Highlight text in project select when user clicks the input #3261
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3261 +/- ##
=======================================
Coverage 81.99% 81.99%
=======================================
Files 605 605
Lines 35111 35117 +6
Branches 5692 5711 +19
=======================================
+ Hits 28789 28794 +5
+ Misses 5490 5479 -11
- Partials 832 844 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/project-select/project-select.component.ts
line 203 at r1 (raw file):
// Select all the text so the user can begin typing to replace it input.select(); }
This change makes it difficult to click inside (particular on mobile) the text element and edit it.
If you changed it to something like:
private inputSelected = false;
inputBlurred(): void {
this.inputSelected = false;
}
inputClicked(event: MouseEvent): void {
this.autocompleteTrigger.openPanel();
const input = event.target as HTMLInputElement;
// Select all the text on first click so the user can begin typing to replace it
if (!this.inputSelected) {
input.select();
this.inputSelected = true;
}
}
and added (blur)="inputBlurred()"
to the<input>
, then only the first click would select all of the text, and subsequent clikcs would allow the user to click in the select or edit portions of the input value.
Code quote:
inputClicked(event: MouseEvent): void {
this.autocompleteTrigger.openPanel();
const input = event.target as HTMLInputElement;
// Select all the text so the user can begin typing to replace it
input.select();
}
2b8c34f
to
7ae2aa1
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @RaymondLuong3)
7ae2aa1
to
8cfbc99
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 @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/project-select/project-select.component.ts
line 204 at r2 (raw file):
} inputClicked(event: MouseEvent): void {
Maybe we should instead be listening to the focus event?
When a user wants to edit the project in a project select, they have to manually highlight and delete the currently selected project. This change updates the project select so that when a user clicks in the input, the currently selected project text is highlighted and the user can begin typing to clear the previously selected project.
This change is