fix(dialog): prevent opened-changed to be sent when it is not changing
This commit is contained in:
parent
125f606f89
commit
1e2f92b2f1
2 changed files with 4 additions and 1 deletions
|
|
@ -62,7 +62,7 @@ export const OverlayMixinImplementation = superclass =>
|
|||
*/
|
||||
requestUpdateInternal(name, oldValue) {
|
||||
super.requestUpdateInternal(name, oldValue);
|
||||
if (name === 'opened') {
|
||||
if (name === 'opened' && this.opened !== oldValue) {
|
||||
this.dispatchEvent(new Event('opened-changed'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@ export function runOverlayMixinSuite({ tagString, tag, suffix = '' }) {
|
|||
await el.updateComplete;
|
||||
expect(spy.callCount).to.equal(1);
|
||||
expect(el.opened).to.be.true;
|
||||
el.opened = true;
|
||||
await el.updateComplete;
|
||||
expect(spy.callCount).to.equal(1);
|
||||
await el._overlayCtrl.hide();
|
||||
await el.updateComplete;
|
||||
expect(spy.callCount).to.equal(2);
|
||||
|
|
|
|||
Loading…
Reference in a new issue