-
Notifications
You must be signed in to change notification settings - Fork 47
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
Autocomplete input field not updating #766
Comments
@DonCamillo11 Without an code example that can be copy/pasted to reproduce the issue, best I can do is suggest:
|
@jeffchown Thanks, but unfortunately this doesn’t solve the issue. Problem is, that this is a quite complex structure with nested components. Not that easy to extract a code example. I think it has to do with dynamically generates elements. I will see if I can extract a code example. |
For now I figured out that removing the |
@DonCamillo11 Without a complete code sample to reference/use, best next guess is you could try adding |
@jeffchown OK, here is a simple example:
For the last element, the input field is not updated. Removing the
|
@DonCamillo11 You example isn't quite complete, you have a line in your code |
@jeffchown Just ignore, I forgot to delete that. I edited the example. |
@DonCamillo11 Having the same |
@jeffchown Do you mean the input field and the autocomplete? This is just to show that it is working with the |
@DonCamillo11 Also, your |
@DonCamillo11 What exactly are you trying to accomplish? It's not clear from your description. Autocomplete may not be your best choice. |
@jeffchown Thanks, but this doesn’t matter for the example (but edited the example code). |
@DonCamillo11 It matters because I don't understand what your ultimate desired behaviour is. If you just want it to update without needing a page refresh, then add If not either of those, then I need more detail re: desired result/behaviour. |
@jeffchown As shown in the example, I want to update the value by click. But, as you can see, the last field isn’t set. My |
To make it clearer, here is an example of how it should work. But at the end, you can see, the desired title field is not set. Bildschirmaufnahme.2024-11-28.um.16.23.28.mov |
@DonCamillo11 I've edited your Blade to provide some more feedback:
On initial display: After entering It is doing exactly what your code is telling it to, updating the current value then adding another item to the bottom of the
|
It’s not doing exactly what the code is telling it to. The expected behaviour is a new item in the Bildschirmaufnahme.2024-11-28.um.16.52.48.movTesting it with a simple input field on top of the autocomplete, it shows the expected behaviour. Bildschirmaufnahme.2024-11-28.um.17.05.53.mov |
@DonCamillo11 That helps! The One solution would be to add the 'custom' value entered into the autocomplete's input to each subsequent autocomplete's |
@jeffchown Thanks for the solution, but thats not working either. Tried to add As mentioned above, for now I use the |
@DonCamillo11 This is what I was trying to describe: in your component:
your Blade:
produces this: |
@DonCamillo11 Given your example/video, my suggestion addresses the issue re: custom values. The last one could be fixed with That said, based on your initial "It can be any term from the database", I don't believe this implementation is the most effective. I'm taking a break, then will see if I can put an example together. |
@DonCamillo11 UPDATE: Whew! We got there in a roundabout way 🙃, but now that I (think) I totally understand your issue, and after trying a few different things to make sure we weren't missing anything, I've been able to reproduce it consistently using the code below. @calebporzio @joshhanley Please help @DonCamillo11 and I figure this one out, we've spent a lot of time on it. Thanks in advance. Summary:
Code: \App\Models\Document
resources\views\livewire\766.blade.php // for this issue #766, tested in view using
|
@jeffchown Thank you for your efforts. I think we are getting closer to the problem now 😀 Let’s see if there is a solution ... |
You're welcome, @DonCamillo11 🤞 |
Wow, this one looks deep. Thank you for distilling it down for us @jeffchown & @DonCamillo11, we will look into this soon when we're back from break |
You're welcome, @calebporzio Happy (belated) Thanksgiving! |
@DonCamillo11 thanks for reporting and thanks @jeffchown for helping narrow it down! I've submitted a PR with a fix. |
@joshhanley Thanks, but it’s still not working in v1.1.2. |
@DonCamillo11 PR hasn’t been merged yet, that’s why this issue is still open 🙂 |
@joshhanley do you have any updates on this PR? |
I have a strange behavior with the autocomplete. The input field does not update after a new value has been set. If I save the value and reload the page, the value is there. To test it, I put a normal input field on top and it works as it should. The value is set correctly, otherwise it would not be set in the input field. No idea why this is happening, it seems to be a simple input field.
Edited: I forgot to mention that the value does not come from the autocomplete list. It can be any term from the database. It is working with a value from the autocomplete list.
This is my code:
Autocomplete after updating the value
Autocomplete after reload
The text was updated successfully, but these errors were encountered: