diff --git a/src/TwigComponent/src/ComponentAttributes.php b/src/TwigComponent/src/ComponentAttributes.php index 82f9a5cdd41..bd4029145e2 100644 --- a/src/TwigComponent/src/ComponentAttributes.php +++ b/src/TwigComponent/src/ComponentAttributes.php @@ -80,7 +80,7 @@ public function __toString(): string // xml:*, xmlns:*, // - special syntax names (Vue.js, Svelte, Alpine.js, ...) // v-*, x-*, @*, :* - if (!ctype_alpha(str_replace(['-', '_', ':', '@', '.'], '', $key))) { + if (!ctype_alnum(str_replace(['-', '_', ':', '@', '.'], '', $key))) { $key = (string) $this->escaper->escape($key, 'html_attr'); } diff --git a/src/TwigComponent/tests/Unit/ComponentAttributesTest.php b/src/TwigComponent/tests/Unit/ComponentAttributesTest.php index 377822c3118..255364ca48e 100644 --- a/src/TwigComponent/tests/Unit/ComponentAttributesTest.php +++ b/src/TwigComponent/tests/Unit/ComponentAttributesTest.php @@ -324,6 +324,7 @@ public static function provideSpecialSyntaxAttributeNames(): iterable yield ['@click']; // Alpine.js yield ['x-on:click']; + yield ['@input.debounce.500ms']; } public function testThrowsTypeErrorWithoutEscaperRuntime(): void