Skip to content
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

Bug: Home key doesn't move to the 1st character when renaming item in List View layout #15048

Open
andrew-james-heard opened this issue Mar 25, 2024 · 6 comments · May be fixed by #15225
Open
Labels
bug Something isn't working good first issue Good issue for new contributors to get started with

Comments

@andrew-james-heard
Copy link

Description

When renaming a file with a long name in Windows Explorer, the whole name is displayed, whereas Files only displays part of the name. In Files, when the name is in edit mode (F2) the Home & End keys only move to the start & end of the visual/ displayed text rather than the 1st or last character. This issue seems to stem from Files difference in how it displays long file names; generally they are shown in a truncated form whereas Explorer generally shows the whole name.

Steps To Reproduce

  1. say clipboard contains "this is a long file name, this is a long file name" but the layout is List, showing 28 characters.
  2. move focus to any file
  3. press F2 to rename the file
  4. press ctrl+V to paste the new long filename
  5. observe only a truncated part of the new long filename is displayed, and pressing Home only moves the cursor to the 1st displayed character rather than (as with Explorer) the 1st actual character

Requirements

Not quite sure, but its currently confusing. Initially I thought a truncated name was being pasted, but you can use the cursor-left key to see all the other characters are actually pasted, just not displayed.

Files Version

3.3

Windows Version

11 23H2

Log File

this should be optional?

@andrew-james-heard andrew-james-heard added the bug Something isn't working label Mar 25, 2024
@yaira2
Copy link
Member

yaira2 commented Mar 25, 2024

Thank you for the report, I can repro this issue in the List View as well. Interestingly it's not an issue in the Details View.

@yaira2 yaira2 changed the title Bug: the Home key doesn't move to the 1st character when pasting long text from clipboard into file to be renamed Bug: Home key doesn't move to the 1st character when renaming item in List View layout Mar 25, 2024
@yaira2 yaira2 added the good first issue Good issue for new contributors to get started with label Mar 25, 2024
@andrew-james-heard
Copy link
Author

Wow - can I give you 11 out of 10 stars for speed of testing?

@yaira2
Copy link
Member

yaira2 commented Mar 25, 2024

Having clear repro steps helps in this regard!

Reproducing doesn't mean it'll be fixed right away, but it does mean that it's added to our project board and marked as ready to build.

@nunescostr
Copy link

I think I know how to fix this, may I be assigned to this ? Also should I write tests for it ?

Thank you.

@Josh65-2201
Copy link
Member

If your able to fix this issue, just open a PR with it.

nunescostr added a commit to nunescostr/Files that referenced this issue Apr 5, 2024
…en renaming item in List View Layout. The Home and end key weren't being acknowledged by the textBox.Keydown on the List View, Grid View and Tile View Layouts. To fix this I replaced it with textBox.PreviewKeyDown, this way the handling is not being consumed before it reaches the controller. I had to implement specific handling for these keys on the switch case already implemented on the GridLayoutPage.xaml.cs.
@yaira2
Copy link
Member

yaira2 commented Apr 5, 2024

Also should I write tests for it ?

Tests aren't necessary but you should verify it works and include the steps you used to verify in the PR.

nunescostr added a commit to nunescostr/Files that referenced this issue Apr 17, 2024
…en renaming item in List View Layout. The Home and end key weren't being acknowledged by the textBox.Keydown on the List View, Grid View and Tile View Layouts. To fix this I replaced it with textBox.PreviewKeyDown, this way the handling is not being consumed before it reaches the controller. I had to implement specific handling for these keys on the switch case already implemented on the GridLayoutPage.xaml.cs.
nunescostr added a commit to nunescostr/Files that referenced this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good issue for new contributors to get started with
Projects
Status: 🏗 In progress
4 participants