Files icon indicating copy to clipboard operation
Files copied to clipboard

Problem creating files when typing the name in Chinese

Open KingRayCao opened this issue 3 years ago • 5 comments

Description

When I try to create a folder or file and try to type the name in Chinese, I can't create it immediately(the button below remains grey.). Rather, I have to delete one charactor to make the ‘create’ button available.

Steps To Reproduce

No response

Expected behavior

I can directly create the file without deleting a charactor.

Files Version

Version: 2.3.3.0 OS Version: 10.0.22000.795

Windows Version

Windows 11 21H2 22000.795

Relevant Assets/Logs

problem

KingRayCao avatar Jul 14 '22 02:07 KingRayCao

I think it has to do with the fact that you aren't typing the name into the text box. Does it work if you type the text directly?

On our end, this can be resolved by adding a text changed event.

yaira2 avatar Jul 14 '22 05:07 yaira2

This has to do don't write the code write actual text

Octoowner88 avatar Jul 14 '22 13:07 Octoowner88

Well, typing in English works totally fine, for the text is directly typed in. I've also discovered that if you first type in some Chinese charactors, and then a space, the button will become available. Besides, if you paste Chinese charactors into the text box, the button is available

KingRayCao avatar Jul 14 '22 13:07 KingRayCao

add a text change event

FkLalita avatar Jul 19 '22 00:07 FkLalita

I met same question and I'll type space to fix it

Antony-Jia avatar Sep 09 '22 01:09 Antony-Jia

Is this still an issue? I am new to open source but I would like to try and tackle this issue!

andrewruales avatar Sep 29 '22 23:09 andrewruales

Yes, the problem still exists

Antony-Jia avatar Sep 30 '22 00:09 Antony-Jia

Any advice for where I could find this issue in code?

andrewruales avatar Sep 30 '22 02:09 andrewruales

I thought ` //Create file based on dialog result (ReturnResult Status, IStorageItem Item) created = (ReturnResult.Failed, null); switch (itemType) { case AddItemDialogItemType.Folder: userInput = !string.IsNullOrWhiteSpace(userInput) ? userInput : "NewFolder".GetLocalizedResource(); created = await associatedInstance.FilesystemHelpers.CreateAsync( StorageHelpers.FromPathAndType(PathNormalization.Combine(currentPath, userInput), FilesystemItemType.Directory), true); break;

            case AddItemDialogItemType.File:
                userInput = !string.IsNullOrWhiteSpace(userInput) ? userInput : itemInfo?.Name ?? "NewFile".GetLocalizedResource();
                created = await associatedInstance.FilesystemHelpers.CreateAsync(
                    StorageHelpers.FromPathAndType(PathNormalization.Combine(currentPath, userInput + itemInfo?.Extension), FilesystemItemType.File),
                    true);
                break;
        }`

may not can't tell if it's over when met special characters

Antony-Jia avatar Sep 30 '22 02:09 Antony-Jia

Awesome, which file should I make this addition to?

andrewruales avatar Sep 30 '22 03:09 andrewruales

@andrewruales this issue is a result of custom logic that handles unlocking the create button when input is entered, should be pretty simple to fix.

yaira2 avatar Oct 02 '22 21:10 yaira2

@yaira2 I actually can't reproduce this; was this maybe unintentionally fixed? could also just be my machine...

jiejasonliu avatar Jan 20 '23 07:01 jiejasonliu