Skip to content

fix: add initIn scoped initialization and select re-init support - #158

Closed
social5h3ll wants to merge 1 commit into
hunvreus:mainfrom
social5h3ll:fix/initIn-scoped-initialization
Closed

fix: add initIn scoped initialization and select re-init support#158
social5h3ll wants to merge 1 commit into
hunvreus:mainfrom
social5h3ll:fix/initIn-scoped-initialization

Conversation

@social5h3ll

Copy link
Copy Markdown

Adds window.basecoat.initIn(container, options?) for scoped initialization of components within a specific DOM container, enabling proper support for partial DOM replacement with htmx, Turbo, Unpoly, and similar tools.

Also fixes a bug where the select component's event listeners weren't properly cleaned up on re-initialization, causing duplicate handlers and broken behavior.

API:

  • window.basecoat.initIn(container) - init all components in container
  • window.basecoat.initIn(container, { component: 'select', force: true }) - init specific component, optionally force re-init

Closes #151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant