36 Replies
im using livewire and testing a simple crud app
but when im adding my components (input) to a modal
after updating or adding a new user input wont get refresh
but the value of the model will be empty
but input will still have the value and not refresh it
im even use resset function and still not work
$this->reset(['name', 'lastname', 'number']);
anyone know the problem ? here is my code
this my blade file
i read all the document and ask some people + ais but i got no answers
i also clear the cache but it wont works
can you reduce the code to 5% it's size and still reproduce the issue?
what u mean ?
because nobody is going to read almost 16kb of that horrible language to help you
plus the code you have outside
oh mb 🤣
thats why you dont get any answers
thats still way too big
i think i need to send it in multy parts
discord dont let me send all az a text
thats because it is still way too much
this is 1 of my inputs
im using in my blade file rn
and also
no no no
can you grab your code, and shave it as much as possible, until what is left cant be reduced any further while still showing the problem?
i see you have an x-crude.input component
like this ?
is it really required? or can you reproduce it with a normal input?
if i grab that code, can i reproduce the error?
nop
then it isnt a minimal reproducible example
im trying to dont send the thing its not necesery but they are so many 😅
Stack Overflow
How to create a Minimal, Reproducible Example - Help Center
Stack Overflow | The World’s Largest Online Community for Developers
read that
seriously, read this
i will make one from scratch
yes, start from scratch and try to cause the problem
just add the minimum to cause the problem
if the problem happens, remove stuff until it doesnt cause the problem
add back what you removed and see if the problem happens
keep at it until adding or removing some small portion causes or fixes the issue
ok i got a public named $name and its empty
and i have a form it have input with wire model name az name so it will get the item from input and send it to the $name
but there is a problem
after i submit it public $name will be empty but input still have the value
and even i try to submit it it say the input its empty but still there is value on it
example
does it happen if you use an actual input?
yes real input have same problem
even if i dont use components
right now, you are still using that misterious x-crid.input field
i fix it
but it still have the same problem
i use similer method like this 3 day ago and it was working fine i dont know why this happen now
your input doesnt have a name
but im using wire model
even i use the name="name"
it still wont refrsh the input
you're right
wire:model should take care of it
ye
can you remove the name and id and try again?
ye it still got same issue
and even try to add a value with $name
but still no work
you validate and cancel imediately after
ye cuse i make the code shorter
in middel of them it will create a row in data base and add name + last name + number
in the orginal code have problem too
.
the problem is i dont know why the content of the input wont get resset after submiting and input still have a value like place holder but in public $name there is no value and its empty
i fix the problem
<script src="//unpkg.com/alpinejs" defer></script>
this script was in my layot file
🤣 🤣 🤣
the code was working fine only this script block it some how
that does seem to have the potential to interfeer with the code
that explains why the code looked fine to me: because it was
ye code was working fine after i add some component i add this script by mistake
thats fine
it happens
but reducing did help to see that the code is fine