Overlay beforeShow/afterShow do not set cancellable flag by default

Status
This content is read-only, or is not open for further replies.

Xon

Guest
offline
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...
 
Liked by:
Status
This content is read-only, or is not open for further replies.
Top Bottom