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] Cursor disappears from "Requesting" amount box (after first digit is entered) #2562

Open
OverActiveBladderSystem opened this issue Dec 23, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@OverActiveBladderSystem

What happened?

In the example photo below on the "Offer Builder" screen, I first select an NFT to offer, I then select XCH to request "1000" for it, after entering "1" the cursor disappears and I must click back on the box to finish adding "000" to the amount requested.

Side notes after experimenting a little...

...if after experiencing the cursor problem, I collapse and expand the XCH box on the "Requesting" side, it will allow me to enter the full amount without issue

...if I select XCH on the "Requesting" side first (rather than selecting an NFT on the "Offering" side first) it will allow me to enter the full amount without issue

...(continuation of issue for other entry field) if I select an NFT to offer, then request "Tokens" and choose a specific "asset type" first then enter an amount second the cursor will disappear after the first digit is entered, if I select "Tokens" and enter an amount first (before selecting a specific "asset type") I can enter the full amount without issue

...if I return to the main "Offer Management" screen (click the "Offer" icon, or back button) I can click the "create an offer" button and repeat the cursor issue
Screenshot (9)

Version

2.5.0

What platform are you using?

Windows

What ui mode are you using?

GUI

Relevant log output or stacktrace

No response

@OverActiveBladderSystem OverActiveBladderSystem added the bug Something isn't working label Dec 23, 2024
@ChiaMineJP ChiaMineJP self-assigned this Dec 24, 2024
@ChiaMineJP
Copy link
Contributor

ChiaMineJP commented Dec 24, 2024

Thanks for reporting.
I could reproduce this issue sometimes but not always.

Technical details

This seems caused by React component re-rendering but not 100% sure yet.
=> Confirmed. As I expected, losing focus is caused by unmounting <TextField/> / <NumberFormatCustom/> elements. We should check what triggers unmounting/re-rendering but this involves React's reconciliation process...
What we can do for now is to eliminate the cause to re-render as far as possible, like use more useMemo / useCallback.

Update
I'm triing a solution which adds autoFocus attribute to <Amount/>in order to focus again on re-mounting <Amount/>.

@ChiaMineJP
Copy link
Contributor

@OverActiveBladderSystem I've created a patch installer for Windows.
https://github.com/Chia-Network/chia-blockchain/actions/runs/12494147367/artifacts/2361625224

The version is fully compatible with 2.5.0.

Could you check whether the patched GUI works for this issue? (Confirm that the new GUI never loses focus(cursor) in the situation above.)

@OverActiveBladderSystem
Copy link
Author

@OverActiveBladderSystem I've created a patch installer for Windows. https://github.com/Chia-Network/chia-blockchain/actions/runs/12494147367/artifacts/2361625224

The version is fully compatible with 2.5.0.

Could you check whether the patched GUI works for this issue? (Confirm that the new GUI never loses focus(cursor) in the situation above.)

I tried the version above which shows up as 2.5.1.dev2 in the log file, when making offer files I was able to enter the full 1000 amount without the cursor disappearing after the first digit, so it seems the cursor issue is resolved for me.

(current issue resolved, new issue discovered)

I did however experience a new issue when using the 2.5.1.dev2 version linked above, but I am not sure if its related to the cursor changes or something else that may be within the developer version and still subject to change?

(photo 1) After opening the 2.5.1.dev2 client and going to the NFT tab I am unable to see the NFT I moved over to test with, both the full node and wallet are fully syncd
Screenshot (2535)

(photo 2) if I "logout" of the wallet using the button in the GUI and select the same wallet
Screenshot (2536)

(photo 3) the NFT will now display after re-entering the same wallet I was in before, side note, the term "bram" I was searching for before remains in the search field after reloading the wallet, I'm not sure if thats intended to remain after re-entering wallet?
Screenshot (2537)

I switched back to 2.5.0 and was not able to reproduce this missing NFT issue, as the NFT shows up immediately upon starting the GUI, so something that changed between these two versions seems to be affecting the display of NFTs.

@ChiaMineJP
Copy link
Contributor

@OverActiveBladderSystem The updated installer is completely based on 2.5.0 only with this patch applied.

I don't think this patch affected NFT and any other behaviour except for input focus issue, so it's highly likely the temporal problem or install/re-install issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants