Git Product home page Git Product logo

Comments (5)

KevinBatdorf avatar KevinBatdorf commented on May 27, 2024

Hi @leobm

Thanks for this report. I'll set up a demo and try it out. There's likely going to be some edge cases that need to be worked out, or that might just not work. Good to figure them out though.

Any difference if you use $component()? That works slightly different behind the scenes.

I might not get back to you until tomorrow though.

from alpine-magic-helpers.

KevinBatdorf avatar KevinBatdorf commented on May 27, 2024

I put your code here with the source code https://codepen.io/KevinBatdorf/pen/8dd61ec92f00eb90ba48eee6bc6b8665?editors=1010

from alpine-magic-helpers.

KevinBatdorf avatar KevinBatdorf commented on May 27, 2024

Okay, I figured out the bug. It's related to $el.parentNode.closest('[x-data]') which isn't super reliable to find the parent in hindsight.

Here's a clear example of the bug where you can see it reaching for the wrong component:

https://codepen.io/KevinBatdorf/pen/0b3e58b7f8d6bd1d18b1d6e8e424c908?editors=1010

It's late where I am now though so it won't be until tomorrow before I can implement a fix, so for now I'd suggest switching to $component(), unless you were just testing it out :)

Thank you again though, and I'll update here when I have more info.

from alpine-magic-helpers.

KevinBatdorf avatar KevinBatdorf commented on May 27, 2024

Hi, Have a fix if you want to test it out. Will merge it in later

https://codepen.io/KevinBatdorf/pen/b9d3e9746f1156495415f5306b5059bd?editors=1000

from alpine-magic-helpers.

KevinBatdorf avatar KevinBatdorf commented on May 27, 2024

Fixed in 0.3.1

Feel free to open the issue if still experiencing issue. Thanks again for the issue

from alpine-magic-helpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.