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

toggle not working within label #475

Open
pmz opened this issue Sep 25, 2023 · 1 comment
Open

toggle not working within label #475

pmz opened this issue Sep 25, 2023 · 1 comment

Comments

@pmz
Copy link

pmz commented Sep 25, 2023

<label _="on click toggle .bg-gray-300 on me" class="p-4 border rounded cursor-pointer hover:bg-gray-200"> <input type="checkbox" name="{{ category }}" value="{{ option }}" class="hidden"> <div>{{ option }}</div> </label>

This doesn't work. If I replace the label with a div, it works as intended.

Any ideas why? :)

@samueldominguez
Copy link

@pmz I just tried using a very simple setup, also using tailwindcss like you seem to be using and it works as intended:

<html>
    <head>
        <script src="https://cdn.tailwindcss.com"></script>
        <script src="https://unpkg.com/hyperscript.org@0.9.12"></script>
    </head>
    <body>
        <label _="on click toggle .bg-gray-300 on me" class="p-4 border rounded cursor-pointer hover:bg-gray-200">
            My Label
        </label>
    </body>
</html>

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