Coder Social home page Coder Social logo

Comments (2)

driesvints avatar driesvints commented on June 13, 2024

Good spot. I'll try to tackle this soon but currently trying to focus a bit on the docs.

from blade-ui-kit.

driesvints avatar driesvints commented on June 13, 2024

Heya, so I did some digging. Actually, the fact that it would use the same variable is irrelevant because it's scoped in the callback. However, this could never work anyway because there can't be two window.onload calls on the same page as they'd overwrite each other. So the solution to this would be a refactor to a lazy initialize somehow. I'd now refactored all components that used window.onload to Alpine's x-init loading. This should allow components which use a JS callback to initialize JS scripts to be used on the same page.

Also: remember that if you want to use two mapbox components on the same page that you need to set two different ids. The Mapbox component has an id of map by default. Two HTML elements cannot have the same ID. So try this:

<x-mapbox id="map1" />
<x-mapbox id="map2" />

from blade-ui-kit.

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.