From 3b76e86f52a8a6e1e2d69d23a4b1a9f8b60eb4d3 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Mon, 4 Dec 2017 10:37:20 -0800 Subject: [PATCH] Fix :dir selectors with nested custom elements Fixes #4966 --- lib/mixins/dir-mixin.html | 2 +- test/unit/dir.html | 56 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/lib/mixins/dir-mixin.html b/lib/mixins/dir-mixin.html index 075da5f581..773870d575 100644 --- a/lib/mixins/dir-mixin.html +++ b/lib/mixins/dir-mixin.html @@ -16,7 +16,7 @@ const HOST_DIR = /:host\(:dir\((ltr|rtl)\)\)/g; const HOST_DIR_REPLACMENT = ':host([dir="$1"])'; - const EL_DIR = /([\s\w#\.\[\]\*]*):dir\((ltr|rtl)\)/g; + const EL_DIR = /([\s\w-#\.\[\]\*]*):dir\((ltr|rtl)\)/g; const EL_DIR_REPLACMENT = ':host([dir="$2"]) $1'; /** diff --git a/test/unit/dir.html b/test/unit/dir.html index 26f847f206..08d59df7f6 100644 --- a/test/unit/dir.html +++ b/test/unit/dir.html @@ -131,6 +131,54 @@ + + + + + + + + + + +