diff --git a/source/dom/slotted.mjs b/source/dom/slotted.mjs
index 66b1d8dbdacf4d442d224f0e16d39ec9904e933c..bb9065d0d305df1259339dd27adc830465506b25 100644
--- a/source/dom/slotted.mjs
+++ b/source/dom/slotted.mjs
@@ -103,15 +103,19 @@ function getSlottedElements(query, name) {
 			if (!(node instanceof HTMLElement)) return;
 
 			if (isString(query)) {
-				node.querySelectorAll(query).forEach(function (n) {
-					result.add(n);
-				});
-
-				if (node.matches(query)) {
+				if (query.length > 0) {
+					node.querySelectorAll(query).forEach(function (n) {
+						result.add(n);
+					});
+
+					if (node.matches(query)) {
+						result.add(node);
+					}
+				} else {
 					result.add(node);
 				}
 			} else if (query !== undefined) {
-				throw new Error("query must be a string");
+				throw new Error("query must be a string and not empty");
 			} else {
 				result.add(node);
 			}