Allow preventDefault
to be fired up to two times
#2138
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Allow
preventDefault
to be fired up to two times with thediscard
parameter offalse
and thentrue
, for the Received Event and the Display Event.Details
discard
parameter is read when the callback returns. Then the logic continues on with that state.preventDefault(true)
had no effect.preventDefault(false)
can be called multiple times and has no effects due to no state change.Motivation
To allow #2094 to work for wrappers.
Scope
Calling preventDefault twice where the first does not discard and the second discards.
Testing
Unit testing
Manual testing
NotificationLifecycleListener
for the will display event.preventDefault()
preventDefault(true)
display()
NotificationServiceExtension
for the received event.Also test there is no breaking of current behavior when preventDefault(discard: false) is called followed by display, will display the notification.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is