diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c09891..7af0c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -237,6 +237,16 @@ exports.renderer = function(input, out) { # 5.x +## 5.3.x + +### v5.3.0 + +- Fixes [#121](https://github.com/marko-js/marko-widgets/issues/121) - Allow for w-preserve-attrs to enable preservation of attributes: + +```html +
+``` + ## 5.2.x ### v5.2.2 diff --git a/lib/Widget.js b/lib/Widget.js index f013cce..01a69d8 100644 --- a/lib/Widget.js +++ b/lib/Widget.js @@ -556,6 +556,16 @@ Widget.prototype = widgetProto = { var id = fromEl.id; var existingWidget; + var preservedAttrs = toEl.getAttribute('data-w-preserve-attrs'); + if (preservedAttrs) { + preservedAttrs = preservedAttrs.split(/\s*[,]\s*/); + for (var i=0; i