Form elements retain values after navigation using app-location

17 views
Skip to first unread message

Kevin Sheppard

unread,
Oct 24, 2017, 5:46:00 PM10/24/17
to Polymer

Kevin Sheppard

unread,
Oct 25, 2017, 9:10:21 AM10/25/17
to Polymer
I think I know what's going on. Currently, my router, just like with iron-pages, just shows and hides the appropriate element on a matching route. In order to achieve a full "reset" of form controls, I'll need to add and remove elements from the DOM instead of showing and hiding them. 

I see that polymer-shop achieves a similar effect by calling its own _reset() function when the view is hidden https://github.com/Polymer/shop/blob/380739c01444f4ea0c9e9aea1806f9cda9ed145c/src/shop-checkout.html#L548-L558 

Should I go the route of adding/removing the views instead of showing and hiding them, would there be any serious performance implications?

Kevin Sheppard

unread,
Oct 25, 2017, 10:59:09 AM10/25/17
to Polymer
UPDATE: It looks like simply removing and adding the DOM nodes ins't going to do it. I'll have to remove the DOM node, create a new instance of it and re-insert it into the document.
Reply all
Reply to author
Forward
0 new messages