-
Notifications
You must be signed in to change notification settings - Fork 4
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
NgModel support for inputs #44
Conversation
Issue at #35 |
src/components/input/input.tsx
Outdated
} | ||
|
||
private onInput(ev: Event) { | ||
private onInput = (ev: Event) => { |
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.
Declaring methods as fat arrow functions results in them not using the same memory space as normal ones and is heavier.
Is there any reason it has been changed ?
Also, KeyboardEvent
should be used instead.
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.
Yes, the method must send an event from a property in the input component, so it had to remain in its scope.
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.
https://stenciljs.com/docs/templating-jsx
The solution is to keep a normal function and provide the scope in the render function instead :
onInput={(evt: KeyboardEvent) => this.onInput(evt)}
// or
onInput={this.onInput.bind(this)}
src/components/input/input.e2e.ts
Outdated
// Given | ||
const page = await newE2EPage({ | ||
html: ` | ||
<wcs-input /> |
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.
Custom elements are not intended to be used as self-closing, browser behavior is UB on this.
08da173
to
929e5a2
Compare
Remove wcs-input component, the input is now to be used by wrapping with a form field
35db320
to
b3caebb
Compare
TestsComponents wrap native so tests are not our part.