Comments (3)
Can you provide a specific example of where this is applicable?
A few thoughts -
- If we have a JSON structure which is inherently invalid (given a schema), then it's invalid regardless of whether the fields on it are readonly or not. That is to say, all fields should always be validated and the structure as a whole should be considered invalid regardless of the user interface or the user's ability to do anything about it.
- If a field is marked as readonly, then as you point out, the user cannot do anything about it. So perhaps what you're saying is that the user interface elements (the red box) should not appear since it is provoking the user to do something, when in fact, they can't do anything. Which is confusing... is that right?
- If we solve #2 by removing the red box, it wouldn't change the fact that the JSON is invalid. Thus, "saving a form" or taking action with it should still be prevented. However, without the red box or some kind of indication to to the end user as to why they cannot proceed, it could also be confusing.
In the latter case, I think the issue is really the app developers then because they've coded a form that the end user cannot work with. So perhaps we need to detect that and have the warning log to console (debug) that a developer could catch.
What do you think?
from alpaca.
I checked in a change that implements what was described. The user interface "red-box" stuff is restrained so the end user doesn't see it. However, the top object still reports that it is invalid (i.e. control.isValid(true) === false) since one of its child elements is invalid.
The fact that the child element is invalid and also readonly (meaning that the app developer has stranded the end user in an unfortunate and helpless position) is now logged to console at WARN level.
Let me know if this implementation aligns with what you were thinking?
from alpaca.
Going to mark this as closed. Please indicate if there's something still amiss or if we should make other adjustments?
Thanks!
from alpaca.
Related Issues (20)
- Layout/template for ArrayField items?
- format: uri does not accept an IP address HOT 1
- Multiselect order
- Add new item in Array object with multiple selected
- Plans on proceeding with broken TAG-field?
- [Ask] change helper text color
- [Ask] Accessing options of a field from another field
- How do I trigger the per-field validation chain when ANY field changes on the form?
- "too much recursion" with jQuery 3.4 using enum
- textarea data not being set properly
- Missing null checkes
- When Creating A Form Builder, How do I make the checkbox multiple select to be true as default? HOT 1
- Conditional Dependency failing
- Field is excluded in the Alpaca.getValue() when dependent on hidden field
- Unable to set uploaded images in postRender
- Repo Future? HOT 3
- After load form and the first running function in the 'events > change' in the select field the validation stops work
- Is this a bug with the "valid" and "invalid" callbacks inside a View?
- Alpaca Gitana
- $('MyForm').alpaca() causes "Maximum call stack size exceeded" for specific Select Field
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 alpaca.