Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

x-ignore not working on [Blazor] server hosting #4542

Closed
hi-xiaoxin opened this issue Feb 18, 2025 · 0 comments
Closed

x-ignore not working on [Blazor] server hosting #4542

hi-xiaoxin opened this issue Feb 18, 2025 · 0 comments

Comments

@hi-xiaoxin
Copy link

When I use Blazor Server Render, the following code can work properly.

@rendermode @(new InteractiveServerRenderMode(prerender:false))

<div x-data="{ open : false }">
    <button x-on:click="open = !open">Open</button>
    <div>
        <div x-show="open">
            <div>
                Modal Content
            </div>
            <div x-ignore>
                <button x-cloak @onclick="Click">
                    OK (Blazor handle this event)
                </button>
            </div>
        </div>
    </template>
</div>

The x-ignore have ignored the elements handled by Blazor. It's working very well.

When I used (i need x-teleport="body") , problems occurred.

@rendermode @(new InteractiveServerRenderMode(prerender:false))

<div x-data="{ open : false }">
    <button x-on:click="open = !open">Open</button>
    <template>
        <div x-show="open">
            <div>
                Modal Content
            </div>
            <div x-ignore>
                <button x-cloak @onclick="Click">
                    OK (Blazor handle this event)
                </button>
            </div>
        </div>
    </template>
</div>

alpinejs:5 Uncaught TypeError: Cannot set properties of null (setting '_x_teleportBack')
at Function. (alpinejs:5:27023)
at r (alpinejs:5:2323)
at n (alpinejs:5:2353)
at fr (alpinejs:5:2363)
at S (alpinejs:5:5131)
at alpinejs:5:4396
at alpinejs:1:2721
at Array.forEach ()
at MutationObserver.mt (alpinejs:1:2710)

I have only a superficial understanding of the principles of Alpine. I'm not sure how to handle this situation. Maybe it's a bug, or perhaps there are alternative solutions. I would appreciate your assistance.

Thank you

@alpinejs alpinejs locked and limited conversation to collaborators Feb 18, 2025
@joshhanley joshhanley converted this issue into discussion #4543 Feb 18, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant