happy-dom
Advanced tools
Comparing version 15.8.2 to 15.8.3
@@ -30,3 +30,7 @@ import Event from '../../event/Event.cjs'; | ||
[PropertySymbol.onRemoveAttribute](removedAttribute: Attr): void; | ||
/** | ||
* @override | ||
*/ | ||
dispatchEvent(event: Event): boolean; | ||
} | ||
//# sourceMappingURL=HTMLDetailsElement.d.ts.map |
@@ -30,3 +30,7 @@ import Event from '../../event/Event.js'; | ||
[PropertySymbol.onRemoveAttribute](removedAttribute: Attr): void; | ||
/** | ||
* @override | ||
*/ | ||
dispatchEvent(event: Event): boolean; | ||
} | ||
//# sourceMappingURL=HTMLDetailsElement.d.ts.map |
import Event from '../../event/Event.js'; | ||
import HTMLElement from '../html-element/HTMLElement.js'; | ||
import * as PropertySymbol from '../../PropertySymbol.js'; | ||
import EventPhaseEnum from '../../event/EventPhaseEnum.js'; | ||
import MouseEvent from '../../event/events/MouseEvent.js'; | ||
/** | ||
@@ -51,3 +53,17 @@ * HTMLDetailsElement | ||
} | ||
/** | ||
* @override | ||
*/ | ||
dispatchEvent(event) { | ||
const returnValue = super.dispatchEvent(event); | ||
if (!event[PropertySymbol.defaultPrevented] && | ||
event[PropertySymbol.target]?.[PropertySymbol.localName] === 'summary' && | ||
event.type === 'click' && | ||
event.eventPhase === EventPhaseEnum.bubbling && | ||
event instanceof MouseEvent) { | ||
this.open = !this.open; | ||
} | ||
return returnValue; | ||
} | ||
} | ||
//# sourceMappingURL=HTMLDetailsElement.js.map |
{ | ||
"name": "happy-dom", | ||
"version": "15.8.2", | ||
"version": "15.8.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/capricorn86/happy-dom", |
@@ -5,2 +5,4 @@ import Event from '../../event/Event.js'; | ||
import Attr from '../attr/Attr.js'; | ||
import EventPhaseEnum from '../../event/EventPhaseEnum.js'; | ||
import MouseEvent from '../../event/events/MouseEvent.js'; | ||
@@ -60,2 +62,21 @@ /** | ||
} | ||
/** | ||
* @override | ||
*/ | ||
public override dispatchEvent(event: Event): boolean { | ||
const returnValue = super.dispatchEvent(event); | ||
if ( | ||
!event[PropertySymbol.defaultPrevented] && | ||
event[PropertySymbol.target]?.[PropertySymbol.localName] === 'summary' && | ||
event.type === 'click' && | ||
event.eventPhase === EventPhaseEnum.bubbling && | ||
event instanceof MouseEvent | ||
) { | ||
this.open = !this.open; | ||
} | ||
return returnValue; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12203960
244877