From 65b9f916cbf39dda64c1295c4191d649322e1ba1 Mon Sep 17 00:00:00 2001 From: cigaar Date: Wed, 23 Oct 2019 14:53:22 +0100 Subject: [PATCH] Update PNotifyConfirm.html Will throw a TypeError exception "Cannot read property 'focus' of undefined" if none of the buttons has promptTrigger, because in that case i = -1 by the time we get to line this.refs.buttons.children[i].focus();. --- src/PNotifyConfirm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PNotifyConfirm.html b/src/PNotifyConfirm.html index 0157171f..b2cbdc61 100644 --- a/src/PNotifyConfirm.html +++ b/src/PNotifyConfirm.html @@ -175,11 +175,11 @@ let i = buttons.length - 1; while (i >= 0) { if (buttons[i].promptTrigger) { + this.refs.buttons.children[i].focus(); break; } i--; } - this.refs.buttons.children[i].focus(); } } },