Skip to content

Commit

Permalink
feat(bootstrap): change add-on::onClick callback signature
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The two first argument of `onClick` handler has been replaced by `field` instance

fix #2617
  • Loading branch information
aitboudad committed Nov 30, 2021
1 parent 015c25f commit f063d2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ UPGRADE FROM 5.0 to 6.0
+ },
}),
```

@ngx-formly/bootstrap
---------------------
* add-on: The two first argument of `onClick` handler has been replaced by `field` instance.

```patch
- onClick: (to, fieldType, $event) => ...,
+ onClick: (field, $event) => ...,
```
4 changes: 2 additions & 2 deletions src/ui/bootstrap/addons/src/addons.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { FieldWrapper } from '@ngx-formly/core';
})
export class FormlyWrapperAddons extends FieldWrapper {
addonRightClick($event: any) {
this.to.addonRight.onClick?.(this.to, this, $event);
this.to.addonRight.onClick?.(this.field, $event);
}

addonLeftClick($event: any) {
this.to.addonLeft.onClick?.(this.to, this, $event);
this.to.addonLeft.onClick?.(this.field, $event);
}
}

0 comments on commit f063d2b

Please sign in to comment.