RSS Feed/News Overlay beforeShow/afterShow do not set cancellable flag by default

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
26,006
Points
823

Reputation:

Code:

Code:
const e = new Event('overlay:before-show')

options.beforeShow(overlay, e)
if (e.defaultPrevented)
{
    return
}

If a _beforeShow implementation calls e.preventDefault(); this will silently fail. Setting e.cancelable = true; before the call will then work but is very much an unexpected break.

This applies to _afterShow as well.

Continue reading...
 
Status
Not open for further replies.
Top