Skip to content
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

Merged
merged 10 commits into from
Mar 20, 2018

Conversation

anna-zhernovkova
Copy link
Contributor

Fix T614207

@@ -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(() => {
Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -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');
Copy link
Contributor

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

Copy link
Contributor Author

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.

@anna-zhernovkova anna-zhernovkova merged commit 1966c4e into master Mar 20, 2018
@anna-zhernovkova anna-zhernovkova deleted the prevent_event branch March 20, 2018 14:02
anna-zhernovkova added a commit that referenced this pull request Mar 20, 2018
)

* 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
anna-zhernovkova added a commit that referenced this pull request Mar 20, 2018
) (#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
@anna-zhernovkova anna-zhernovkova added this to the 18.1.1-beta.3 milestone Mar 21, 2018
@anna-zhernovkova anna-zhernovkova changed the title Prevent option change event firing when changes occur in component Prevent valueChanges event when patchValue method is used with emitEvent=false Mar 21, 2018
dxvladislavvolkov added a commit to dxvladislavvolkov/devextreme-angular that referenced this pull request Apr 10, 2018
dxvladislavvolkov added a commit to dxvladislavvolkov/devextreme-angular that referenced this pull request Apr 10, 2018
dxvladislavvolkov added a commit that referenced this pull request Apr 10, 2018
dxvladislavvolkov added a commit that referenced this pull request Apr 10, 2018
…onent (#712) (#744)

* Revert "Prevent option change event firing when changes occur in component (#712) (#717)"

This reverts commit 08a40ba.

* Update shippable config

* Fix tests
dxvladislavvolkov pushed a commit to dxvladislavvolkov/devextreme-angular that referenced this pull request Apr 13, 2018
…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
dxvladislavvolkov pushed a commit to dxvladislavvolkov/devextreme-angular that referenced this pull request Apr 13, 2018
…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
dxvladislavvolkov added a commit that referenced this pull request Apr 13, 2018
) (#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
dxvladislavvolkov added a commit that referenced this pull request Apr 13, 2018
) (#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants