In CBWIRE, the wire:ignore directive allows you to prevent specific sections of your page from updating during user interactions. Use this to maintain certain elements unchanged, particularly when incorporating third-party JavaScript libraries that handle their own DOM manipulations.

Example: Ignoring Date Picker

For example, if your project incorporates a JavaScript library for improved input functionality, it's essential to prevent any interference from CBWIRE. Follow these steps to ensure seamless integration:

    <!-- Your form elements here... -->

    <div wire:ignore>
        <!-- This input is managed by a third-party date picker library -->
        <input id="id-for-date-picker-library">

    <!-- Other form elements... -->

For scenarios where you want CBWIRE to disregard attribute modifications on an element but still track updates to its content, utilize the wire:ignore.self directive.

<div wire:ignore.self>
    <!-- Content inside can update, but attribute changes on the div itself are ignored -->

This functionality enables CBWIRE to integrate smoothly with other scripts and libraries. It ensures a balanced interaction between dynamic and static components, enhancing overall performance and compatibility.

Last updated