summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/htmx.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/htmx.js b/src/htmx.js
index 597c9b3b..d5d6b036 100644
--- a/src/htmx.js
+++ b/src/htmx.js
@@ -864,13 +864,12 @@ return (function () {
if (oobSelects) {
var oobSelectValues = oobSelects.split(",");
for (var i = 0; i < oobSelectValues.length; i++) {
- var oobSelectValue = oobSelectValues[i].split(":", 2);
- var id = oobSelectValue[0].trim();
- if (id.indexOf("#") === 0) {
- id = id.substring(1);
- }
- var oobValue = oobSelectValue[1] || "true";
- var oobElement = fragment.querySelector("#" + id);
+ var oobSelectValue = oobSelectValues[i]
+ // Support colon in css selectors
+ var colon = oobSelectValue.lastIndexOf(':')
+ var split_at = colon == -1 ? oobSelectValue.length : colon
+ var oobValue = oobSelectValue.substring(split_at + 1) || 'true'
+ var oobElement = fragment.querySelector(oobSelectValue.substring(0, split_at))
if (oobElement) {
oobSwap(oobValue, oobElement, settleInfo);
}