Skip to content

Commit

Permalink
fix(core): avoid endless loop on input error handling (#591)
Browse files Browse the repository at this point in the history
* fix(core): avoid endless loop on input error handling and fix wrong behaviour of errorUpdate

* chore: fix linting errors

* fix: add missing headline
  • Loading branch information
fynnfeldpausch authored Oct 24, 2024
1 parent 6afbe1d commit 6c2d191
Show file tree
Hide file tree
Showing 23 changed files with 279 additions and 822 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fromEvent } from 'rxjs';

export const proxyInputs = (Cmp: any, inputs: string[]) => {
const Prototype = Cmp.prototype;
inputs.forEach(item => {
inputs.forEach((item) => {
Object.defineProperty(Prototype, item, {
get() {
return this.el[item];
Expand All @@ -19,14 +19,14 @@ export const proxyInputs = (Cmp: any, inputs: string[]) => {
* we set configurable: true to indicate these
* properties can be changed.
*/
configurable: true
configurable: true,
});
});
};

export const proxyMethods = (Cmp: any, methods: string[]) => {
const Prototype = Cmp.prototype;
methods.forEach(methodName => {
methods.forEach((methodName) => {
Prototype[methodName] = function () {
const args = arguments;
return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
Expand All @@ -35,7 +35,7 @@ export const proxyMethods = (Cmp: any, methods: string[]) => {
};

export const proxyOutputs = (instance: any, el: any, events: string[]) => {
events.forEach(eventName => (instance[eventName] = fromEvent(el, eventName)));
events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
};

export const defineCustomElement = (tagName: string, customElement: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class BooleanValueAccessor extends ValueAccessor {
super(el);
}
writeValue(value: any) {
this.el.nativeElement.checked = this.lastValue =
this.el.nativeElement.value == null ? value : this.el.nativeElement.value === value;
this.el.nativeElement.checked = this.lastValue = this.el.nativeElement.value == null ? value : this.el.nativeElement.value === value;
}
}
Loading

0 comments on commit 6c2d191

Please sign in to comment.