-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent valueChanges event when patchValue method is used with emitEvent=false #712
Conversation
tests/src/core/component.spec.ts
Outdated
@@ -194,6 +194,23 @@ describe('DevExtreme Angular widget', () => { | |||
expect(testSpy).toHaveBeenCalledTimes(1); | |||
})); | |||
|
|||
it('should not emit testOptionChange event when changes happen in component (T614207)', async(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to make this test asynchronous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I will fix it
src/core/component.ts
Outdated
@@ -93,6 +93,15 @@ export abstract class DxComponent implements OnChanges, OnInit, DoCheck, AfterCo | |||
this.instance.endUpdate(); | |||
} | |||
} | |||
lockEventFire(name: string) { | |||
this.eventHelper.lockEventFire.push(name + 'Change'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to have an array here? It seems that it's impossible to have several locked events simultaneously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the case, where we have two events in the array, but it's checked in the correct order. So, we can get rid of array here.
) * Prevent option change event firing when changes occur in component * Update event lockers * Fix typo * Add test for bound options * Simplify lockers * Refactor test * Prevent option change event firing when nested option was changed * Move event locker to writeValue method * Rework test * Fix typo
) (#717) * Prevent option change event firing when changes occur in component * Update event lockers * Fix typo * Add test for bound options * Simplify lockers * Refactor test * Prevent option change event firing when nested option was changed * Move event locker to writeValue method * Rework test * Fix typo
…onent (DevExpress#712)" This reverts commit 1966c4e.
…onent (DevExpress#712) (DevExpress#717)" This reverts commit 08a40ba.
…evExpress#712) * Prevent option change event firing when changes occur in component * Update event lockers * Fix typo * Add test for bound options * Simplify lockers * Refactor test * Prevent option change event firing when nested option was changed * Move event locker to writeValue method * Rework test * Fix typo
…evExpress#712) (DevExpress#717) * Prevent option change event firing when changes occur in component * Update event lockers * Fix typo * Add test for bound options * Simplify lockers * Refactor test * Prevent option change event firing when nested option was changed * Move event locker to writeValue method * Rework test * Fix typo
) (#750) * Prevent option change event firing when changes occur in component * Update event lockers * Fix typo * Add test for bound options * Simplify lockers * Refactor test * Prevent option change event firing when nested option was changed * Move event locker to writeValue method * Rework test * Fix typo
) (#717) (#749) * Prevent option change event firing when changes occur in component * Update event lockers * Fix typo * Add test for bound options * Simplify lockers * Refactor test * Prevent option change event firing when nested option was changed * Move event locker to writeValue method * Rework test * Fix typo
Fix T614207