-
Notifications
You must be signed in to change notification settings - Fork 93
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
Issue with focus being lost on input beta7->beta8 #710
Comments
Can you please test using this patched version? PR for reference: #711 |
In my tests the input field value is erased on fragment merge. Can you please let me know what behaviour you observe? |
I will test the patched version tonight and report back. |
I tested the linked file: https://raw.githubusercontent.com/starfederation/datastar/7c976c115e40af10cb267162a37dc2bf9fa2d70e/bundles/datastar.js The text gets nuked and the focus lost. And the signals seem to be completely gone on merge fragment. My pre tag is showing the ctx.signals.JSON(). and on merge that is gone. Page Load:
After Merge Fragments:
Edit: I think the example: https://data-star.dev/examples/active_search is a good test. I would expect if that works as intended, than its likely to address the behavior I am seeing. |
This should now be fixed in https://raw.githubusercontent.com/starfederation/datastar/79fa7e5f9f3be4604053f2009764992f45a8a12c/bundles/datastar.js Can you please test and confirm? |
I'm not at my home machine, but I rebuilt the example here and it seems like its now resolved. Thanks for tracking it down! |
This snippet below exposes a behavior change to the way inputs and merge fragments interact. In version beta7 and below, the focus would stay on the text input when a fragment came in. However in beta8, now it appears to lose focus on merge fragment. This is true for when a signal is bound to the input.
Snippet:
Backend:
The backend can just send a merge fragment for this html.
Maybe I'm missing something here, but I tried to boil the problem down to the simplest example.
The text was updated successfully, but these errors were encountered: