marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
141 stars 40 forks source link

w-preserve-body on widget root #92

Closed yomed closed 9 years ago

yomed commented 9 years ago
<div w-bind w-preserve-body>

Currently, placing preserve variations on the root of the widget will result in "Error: No widget found." I'm assuming this is because the widget has not yet been created at that point. I could see why w-preserve or w-preserve-if should always be placed on children elements, but I think that w-preserve-body and w-preserve-body-if should be allowed on the root. It makes sense semantically since the the root widget element could be rerendered while the rest of the widget body is set to be preserved.

patrick-steele-idem commented 9 years ago

Looks like a bug. I agree with you that w-preserve related attributes should be allowed on the root elements. I'm going to add a test case to see what I can figure out. Thanks for reporting the problem.