kotlinx.html icon indicating copy to clipboard operation
kotlinx.html copied to clipboard

Attribute names don't accept Alpine.js directives

Open wyaeld opened this issue 5 years ago • 3 comments
trafficstars

alpine.js has directives expressed in html attribute like

<div x-data="{ sidebarOpen: false }" @keydown.window.escape="sidebarOpen = false">

The problem is the @ prefix on the 2nd attribute. This appears to be the same as https://github.com/Kotlin/kotlinx.html/issues/118 which is also unresolved.

Both issues appear valid according to the html spec referenced in https://github.com/Kotlin/kotlinx.html/issues/118, but kotlinx.html is silently discarding them

wyaeld avatar Mar 03 '20 00:03 wyaeld

@cy6erGn0m would it be hard to fix both of these?

wyaeld avatar Mar 03 '20 00:03 wyaeld

This can be worked around a longer form, which looks like

attributes["x-on:keydown.window.escape"] = "sidebarOpen = false"

instead of

attributes["@keydown.window.escape"] = "sidebarOpen = false"

but the later is still valid to the html spec, so whether is should be supported is the question

wyaeld avatar Mar 04 '20 02:03 wyaeld

Any news on this?

There are many frameworks which have this syntax

lgwillmore avatar May 23 '23 07:05 lgwillmore