Comments (4)
If we do it inside the form library, we need to be 100% sure on the semantics. Let us consider the following scenarios where I added my expected output. To summarize: Every visual field should always yield an output with empty fields turning into an empty output. Everything that is invisible does not yield an output.
Input data | Action | Expected output (submitted value) |
---|---|---|
{} |
submit | { creditor: '' } |
{ creditor, foo } |
{ creditor } |
|
{ creditor } |
creditor field cleared | { creditor: '' } |
{ creditor } |
creditor not renderered (cond. rendering) | { } |
Future work in this area is expected, cf. #6, too.
from form-js.
Thanks for opening this issue. An interesting case, indeed.
Does it make sense to do the diffing outside the form library? Or is this something that should strictly be handled inside the form library?
from form-js.
I think it would make more sense to have the diffing inside the form library. Would it make sense to always include all fields, even when they are untouched and empty? This way, it is clear what fields are present in the form.
For the diffing to work outside of the library, we would also need a utility function to know which keys/variables are used in the form. Currently, we sometimes pass data into the form that is not used by the form. These unrelated variables should not be cleared as a side effect.
from form-js.
One further thing to consider: How to handle fields that do not have a natural string based default value, e.g. dates or number inputs? It likely makes sense to have mandatory either a default value or that the field is required.
Alternatively we'd need to re-consider #54 (comment).
from form-js.
Related Issues (20)
- [Implement] Custom HTML component [WIP] HOT 2
- Implement copy and pasting
- [Implement] HTML Viewer Component
- [Implement] Scoped styling WIP HOT 1
- Validation out of sync with value changes HOT 1
- Sanitize/block HTML in FEEL/feelers evaluation
- Auto-resize of textarea should happen on visual text changes, not on debounce triggers HOT 1
- Form preview link sometimes breaks when the branch name cuts off on a dash
- Increment breaks when too many decimals are used in number fields
- Fix/rework `formPlayground.init` event test on `form-playground`
- Wrong icon for popout editor button HOT 2
- Default rows of dynamic list values are cleared HOT 1
- Variables named duration cannot be used in feel expressions HOT 1
- Simple label config no longer disabled for datetime component (all subcomponents)
- Do a clean export of `getSchemaVariables`
- [Implement] Support copying and pasting components in the editor
- Show iframe title in editor
- Implement a sample data generation module. HOT 1
- Improve image component
- Table component demo data is being added when importing an edited table
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-js.