-
Notifications
You must be signed in to change notification settings - Fork 16
Use limel-code-editor in dynamic form example; update CSS max height #3199
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
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| textarea { | ||
| limel-code-editor { | ||
| --code-editor-max-height: 20rem; | ||
| width: 100%; | ||
| min-height: 300px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { Component, h, State } from '@stencil/core'; | ||
| import { Component, h, Host, State } from '@stencil/core'; | ||
| import { FormSchema, ValidationStatus } from '@limetech/lime-elements'; | ||
|
|
||
| /** | ||
|
|
@@ -44,28 +44,37 @@ export class DynamicFormExample { | |
| } | ||
|
|
||
| public render() { | ||
| return [ | ||
| <textarea onChange={this.handleTextChange}>{this.text}</textarea>, | ||
|
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. in the previous version, one could typ inside the textarea and see the results live in the form below. We should make sure that the same thing happens when using the code-editor
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. On testing it doesn't seem to update live in the form below.
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. Screen.Recording.2025-08-11.at.13.45.29.movit seems that the form updates are 1 character behind the actual input of the code editor 🤔
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. it's OK to just close the issue and PR too. This is only in the documentations and we don't have to spend time on fixing it. The equation of the efforts versus value added, is a bit questionable 😅 |
||
| <br />, | ||
| <limel-form | ||
| onChange={this.handleFormChange} | ||
| onValidate={this.handleValidate} | ||
| value={this.formData} | ||
| schema={this.schema} | ||
| />, | ||
| <limel-example-value value={this.formData} />, | ||
| <limel-example-value label="Errors" value={this.errors} />, | ||
| ]; | ||
| return ( | ||
| <Host> | ||
| <limel-code-editor | ||
| language="json" | ||
| lineNumbers={true} | ||
| lint={true} | ||
| fold={true} | ||
| onChange={this.handleTextChange} | ||
| value={this.text} | ||
| /> | ||
| <br /> | ||
| <limel-form | ||
| onChange={this.handleFormChange} | ||
| onValidate={this.handleValidate} | ||
| value={this.formData} | ||
| schema={this.schema} | ||
| /> | ||
| <limel-example-value value={this.formData} /> | ||
| <limel-example-value label="Errors" value={this.errors} /> | ||
| </Host> | ||
| ); | ||
| } | ||
|
|
||
| private handleFormChange = (event: CustomEvent) => { | ||
| this.formData = event.detail; | ||
| }; | ||
|
|
||
| private handleTextChange = (event) => { | ||
| this.text = event.target.value; | ||
| this.text = event.detail; | ||
| try { | ||
| const json = JSON.parse(event.target.value); | ||
| const json = JSON.parse(event.detail); | ||
|
Contributor
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. @Kiarokh I redefined this to fix the lagging render issue in the last fixup |
||
| if (json) { | ||
| this.schema = json; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.