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

:on Event Handler on div prevents rendering when inside a template element #51

Closed
MasterPuffin opened this issue Nov 25, 2024 · 1 comment

Comments

@MasterPuffin
Copy link

Hello,
I found quite an odd bug:
When applying a event handler like :onclick to a div element which is inside an template element, the contents of the div are not rendered.

                        <template :each="area in areas">
                            <div class="border rounded p-4 my-2" :onclick="()=>{highlightArea(area.id)}">
                                <p class="m-0" :text="area.name"></p>
                                <p class="m-0" :text="area.color"></p>
                                <p class="m-0 text-muted text-small" :text="area.id"></p>
                                <button class="form-control btn-outline-primary" :onclick="()=>{edit(area.id)}">Edit
                                </button>
                            </div>
                        </template>

The code above will render the div and the elements within, but the sprae directives are not resolved. The :onclick handler however works.

                        <div :each="area in areas">
                            <div class="border rounded p-4 my-2" :onclick="()=>{highlightArea(area.id)}">
                                <p class="m-0" :text="area.name"></p>
                                <p class="m-0" :text="area.color"></p>
                                <p class="m-0 text-muted text-small" :text="area.id"></p>
                                <button class="form-control btn-outline-primary" :onclick="()=>{edit(area.id)}">Edit
                                </button>
                            </div>
                        </div>

This however works fine, everything is rendered as it should.

                        <template :each="area in areas">
                            <div class="border rounded p-4 my-2">
                                <p class="m-0" :text="area.name"></p>
                                <p class="m-0" :text="area.color"></p>
                                <p class="m-0 text-muted text-small" :text="area.id"></p>
                                <button class="form-control btn-outline-primary" :onclick="()=>{edit(area.id)}">Edit
                                </button>
                            </div>
                        </template>

This however is also rendered fine as well...

@dy dy closed this as completed in bbba88c Nov 30, 2024
@dy
Copy link
Owner

dy commented Nov 30, 2024

@MasterPuffin thanks for the find! Fixed in 11.0.1

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

No branches or pull requests

2 participants