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.
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.
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 whyw-preserve
orw-preserve-if
should always be placed on children elements, but I think thatw-preserve-body
andw-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.