Reputation: 859
Is there a possibility to get an Event or something, before the selected tab changes? I'm looking for something like the window Event "beforeunload", to warn the user if he has any unsaved changes.
Upvotes: 1
Views: 192
Reputation: 138696
You can set an iron-activate
event handler on <paper-tabs>
, which is notified whenever the user selects a tab. The handler could cancel the tab selection by calling event.preventDefault()
:
<paper-tabs on-iron-activate="_onTabActivated">...
_onTabActivated(e) {
if (conditionToCancelSelection) {
e.preventDefault();
}
}
Upvotes: 1