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

Bug in code example of documentation for x-anchor to an ID #3942

Merged

Conversation

MaximVanhove
Copy link
Contributor

The code example uses # in the getElementById function, which breaks the code

// Wrong
document.getElementById('#trigger')

// Right
document.getElementById('trigger')

Full code example

<div x-data="{ open: false }">
    <button id="trigger" @click="open = ! open">Toggle</button>

    <div x-show="open" x-anchor="document.getElementById('trigger')">
        Dropdown content
    </div>
</div>

@MaximVanhove MaximVanhove changed the title Bug in code example of documantation for x-anchor to an ID Bug in code example of documentation for x-anchor to an ID Dec 20, 2023
@calebporzio calebporzio merged commit e3738a3 into alpinejs:main Jan 5, 2024
1 check passed
@calebporzio
Copy link
Collaborator

Thanks!

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.

2 participants