invaders-xx / filament-jsoneditor

MIT License
22 stars 15 forks source link

I misunderstood $getStatePath(). Apologies #6

Closed ziming closed 2 years ago

ziming commented 2 years ago

Hi there,

It turns out my 2 PRs were totally un-needed.

Because $getStatePath() returns not the value of the field, but rather the path to the livewire variable.

So what it actually return is a string like 'data.field_name'

Which mean all my extra code actually did nothing to solve the issue.

Looking at your view file again, I guess the value is fetched at the following line

<div x-data="{ state: $wire.entangle('{{ $statePath }}') }"

However I don't know Livewire well enough to know what should I do to get it working while not screwing up with the Livewire entangle process.

Once again apologies for my earlier 2 PRs. I was sick today and also a bit over confident since I maintain the backpack admin version of the json editor field. Which resulted in me not really testing before I made the PR.

I think the PR fix would be better made by a person more knowledgeable in Livewire and alpine.js

invaders-xx commented 2 years ago

@ziming So what does it means ? We get back to my original version ? If so, can please PR to get back to original code please ?

ziming commented 2 years ago

Ok I will make a PR to reverse my changes. It didn't break your field but it didn't fix the problem I'm trying to fix either.

Hopefully somebody who has more Livewire and alpine knowledge can come along and fix the problem with array and object casted fields that I described earlier.

invaders-xx commented 2 years ago

I can't help you also as my Livewire and Alpine knowledge are poor.

ziming commented 2 years ago

Understandable