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

FormlyWrapperAddons: was the addon templateOptions context intended #2617

Closed
FritzHerbers opened this issue Dec 10, 2020 · 0 comments · Fixed by #2874
Closed

FormlyWrapperAddons: was the addon templateOptions context intended #2617

FritzHerbers opened this issue Dec 10, 2020 · 0 comments · Fixed by #2874

Comments

@FritzHerbers
Copy link
Contributor

In the two addon wrappers, the templateOptions are provided in the first argument to the resulting onClick handler.
https://github.com/ngx-formly/ngx-formly/search?q=FormlyWrapperAddons+extends+fieldwrapper

The templateOptions can be derived from the second argument in the onClick handler (field.to).

Was the intend to provide the addon templateOptions context in the first argument to the resulting onClick handler ?

  addonRightClick($event: any) {
    if (this.to.addonRight.onClick) {
      this.to.addonRight.onClick(this.to, this, $event);   -> this.to.addonRight instead of this.to
    }
  }

  addonLeftClick($event: any) {
    if (this.to.addonLeft.onClick) {
      this.to.addonLeft.onClick(this.to, this, $event);  -> this.to.addonLeft instead of this.to
    }
  }
@aitboudad aitboudad added enhancement and removed bug labels Jan 2, 2021
aitboudad added a commit that referenced this issue May 29, 2021
BREAKING CHANGE: The two first argument of `onClick` handler has been replaced by `field` instance

fix #2617
aitboudad added a commit that referenced this issue Dec 1, 2021
BREAKING CHANGE: The two first argument of `onClick` handler has been replaced by `field` instance

fix #2617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants