-
Notifications
You must be signed in to change notification settings - Fork 71
#72 Now is possibile to pass IRenderFunction to component Render* #83
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
Changes from all commits
4528b31
9025ea3
f0d1b3f
9bc39eb
4e5739d
95e1991
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,7 @@ export class FabBaseTextFieldComponent extends ReactWrapperComponent<ITextFieldP | |
| @Output() readonly onChange = new EventEmitter<{ event: Event; newValue?: string }>(); | ||
| @Output() readonly onBeforeChange = new EventEmitter<{ newValue: any }>(); | ||
| @Output() readonly onNotifyValidationResult = new EventEmitter<{ errorMessage: string; value: string | undefined }>(); | ||
| @Output() readonly onBlur = new EventEmitter<{ event: Event }>(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move these changes to a separate PR. It makes it easier to maintain and create the changelog (this part of the PR looks fine as it is, so if you move it it can get it as-is)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'll try to do it but.... I don't know so well GIT :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically create a new branch from |
||
|
|
||
| /* Non-React props, more native support for Angular */ | ||
| // support for two-way data binding for `@Input() checked`. | ||
|
|
@@ -84,6 +85,7 @@ export class FabBaseTextFieldComponent extends ReactWrapperComponent<ITextFieldP | |
| this.onChangeHandler = this.onChangeHandler.bind(this); | ||
| this.onBeforeChangeHandler = this.onBeforeChangeHandler.bind(this); | ||
| this.onNotifyValidationResultHandler = this.onNotifyValidationResultHandler.bind(this); | ||
| this.onBlurHandler = this.onBlurHandler.bind(this); | ||
| } | ||
|
|
||
| ngOnInit() { | ||
|
|
@@ -95,7 +97,6 @@ export class FabBaseTextFieldComponent extends ReactWrapperComponent<ITextFieldP | |
|
|
||
| onChangeHandler(event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) { | ||
| this.onChange.emit({ event: event.nativeEvent, newValue }); | ||
|
|
||
| this.valueChange.emit(newValue); | ||
| } | ||
|
|
||
|
|
@@ -106,4 +107,8 @@ export class FabBaseTextFieldComponent extends ReactWrapperComponent<ITextFieldP | |
| onNotifyValidationResultHandler(errorMessage: string, value: string | undefined) { | ||
| this.onNotifyValidationResult.emit({ errorMessage, value }); | ||
| } | ||
|
|
||
| onBlurHandler(event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) { | ||
| this.onBlur.emit({ event: event.nativeEvent }); | ||
| } | ||
| } | ||
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.
why is this
undefinedin theDefaultRenderOptionscase?Uh oh!
There was an error while loading. Please reload this page.
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 understand the technical reason of why needing to handle this case is here - but why is returning undefined specifically? Shouldn't there be a render function call here, or rather, a function that creates a render function.
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.
Only because
unreachable(input)throw an error during the compilation.The execution never reach that line of code because the method
createRenderPropHandlerexecutes the cases RenderPropOptions and RenderPropContext.