Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RaymondLuong3
Copy link
Collaborator

@RaymondLuong3 RaymondLuong3 commented Jun 12, 2025

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.

image


This change is Reviewable

@RaymondLuong3 RaymondLuong3 added the will require testing PR should not be merged until testers confirm testing is complete label Jun 12, 2025
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.99%. Comparing base (6d2e621) to head (8cfbc99).

Files with missing lines Patch % Lines
...src/app/project-select/project-select.component.ts 85.71% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pmachapman pmachapman self-requested a review June 16, 2025 21:08
@pmachapman pmachapman self-assigned this Jun 16, 2025
Copy link
Collaborator

@pmachapman pmachapman left a 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();
  }

@RaymondLuong3 RaymondLuong3 force-pushed the fix/SF-3276-configure-source-input branch from 2b8c34f to 7ae2aa1 Compare June 17, 2025 16:00
Copy link
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RaymondLuong3)

@pmachapman pmachapman added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Jun 17, 2025
@pmachapman pmachapman force-pushed the fix/SF-3276-configure-source-input branch from 7ae2aa1 to 8cfbc99 Compare June 17, 2025 19:15
Copy link
Collaborator

@Nateowami Nateowami left a 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?

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

Successfully merging this pull request may close these issues.

3 participants