Confirmation when user leaving the form

24 views
Skip to first unread message

Phu Hiep DUONG

unread,
Sep 30, 2015, 10:41:23 PM9/30/15
to polym...@googlegroups.com
Hello,

How can we implement this feature in Polymer?

Inline images 2

(example from github wiki page editing)

I suppose we have an application based on Polymer Starter Kit (so with page.js as router engine)
- this application uses a product-editor element which contains a textbox + save button. 
- User is editing a product at the route localhost/#!/product/127/edit
- and "accidently" click on the Back button or other links on the page

I'd like to display the above confirmation dialog: "Are you sure you want to leave this page?"

How can we do this?

Thank you




--
/=================================================/
        DUONG Phu Hiep
        Tel: +33 6 68 19 61 34
/=================================================/

Eric Bidelman

unread,
Oct 1, 2015, 3:50:47 PM10/1/15
to Phu Hiep DUONG, polym...@googlegroups.com
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload is what you're looking for. It's not a Polymer feature.

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CABO6%3DysOBxmfPghdgRZ4GXRJHXQPNWwWk%2BCc-S8K5p4bMf0pMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages