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

Dynamic x-data issue #165

Open
HugoDF opened this issue Feb 2, 2021 · 5 comments
Open

Dynamic x-data issue #165

HugoDF opened this issue Feb 2, 2021 · 5 comments
Labels
bug Something isn't working needs-repro

Comments

@HugoDF
Copy link
Collaborator

HugoDF commented Feb 2, 2021

alpinejs/alpine#1060

When I delete/add data in x-data, the data in alpine.js chrome tools is not deleted/added synchronously.

@HugoDF HugoDF added the bug Something isn't working label Feb 2, 2021
@opencoca
Copy link

I'm hitting this same issue.

@KevinBatdorf
Copy link
Contributor

@opencoca Can you give an example of what deleting or adding data in x-data looks like? That way we have something to test against.

@HugoDF
Copy link
Collaborator Author

HugoDF commented Mar 6, 2021

A "refresh" button would be a good workaround for a lot of the "devtools don't update when I do X" issues, I'll create a separate issue for it.

@HugoDF
Copy link
Collaborator Author

HugoDF commented Mar 7, 2021

@opencoca any chance you could share the steps you follow when you hit this issue?

@leodag
Copy link

leodag commented Feb 13, 2022

Not sure if this is the same issue, but I have this example where the extension doesn't update whenever I add/remove/edit any of the fields:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script src="https://unpkg.com/alpinejs" defer></script>
  </head>
  <body x-data="{}">
    <section x-data="{ alternatives: [''] }">
      <div>
        <form>
          <template x-for="(alternative, index) in alternatives">
            <div class="flex">
              <input type="text" x-model="alternatives[index]">
              <button type="button" @click="alternatives.splice(index, 1)" class="btn btn-blue">-</button>
            </div>
          </template>
          <button type="button" @click="alternatives.push('')" class="btn btn-blue self-start">+</button>
        </form>
      </div>
    </section>
  </body>
</html>

Maybe I'm just doing this in a dumb way? Either way, the extension will only update if I select another element and go back to it.

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

No branches or pull requests

4 participants