Comments (6)
Can you give an example to reproduce this bug?
from directus-extension-computed-interface.
Here is a GIF showing the bug:
I think that the computed value must emit a null if the source value is null.
from directus-extension-computed-interface.
We also have this:
I put these logs on interface.vue:63
. Seems that the other computed field emitted a 0, his expression is simple: {{ MULTIPLY(numero,2) }}
.
I think we must check if the source value is null before parse the expression.
from directus-extension-computed-interface.
@duydvu to reproduce this, you can create these fields:
- number (numeric)
- numberx2 (
{{ MULTIPLY(number, 2) }}
- text (string)
- text_slug (
{{ SLUG(text) }}
When you edit the text
field but leaves number
empty and tries to save the item, the numberx2
calculation is triggered and returns 0 (because number(null) x 2 = 0
. Then, Directus complains about you trying to get out from a item that has unsaved changes.
from directus-extension-computed-interface.
Nope, still can't see the bugs. Which Directus version are you using? Mine is 9.10.0
from directus-extension-computed-interface.
Hi @duydvu! Sorry for the long time.
I can still reproduces this on a empty instance of Directus 10.5.3
.
In the most basic example:
- Create a INT field
my_number
with simple input - Create a INT field
my_number_x2
with the computed extension{{ MULTIPLY(my_number, 2) }}
When typing any number then erasing on the source input, the computed input gives me 0
as result, but I think it should be null
.
If the source is a empty value, the computed should be empty too.
This is the same cause that makes the computed field starts with 0
on the video below ("Compute If Empty" is enabled).
Screen.Recording.2023-08-21.at.17.26.21.mov
from directus-extension-computed-interface.
Related Issues (20)
- Feature request/check HOT 1
- Sum Values is not working HOT 7
- Computed Field are not getting date from DateTime Field HOT 1
- Documentation on field names HOT 1
- Does Directus 10.5.3 break this extension? HOT 1
- O2M relation operations failing HOT 1
- Compute on the collection table level HOT 2
- Calculations not work for decimal data type HOT 4
- "compute if empty" HOT 1
- How to overwrite computed value? HOT 3
- CURRENCY(a) format option not working properly HOT 1
- add relation column id, because used static 'id', but id relation can be other
- Unexpected Error when Primary Key Field Name is not `id`
- Not showing up HOT 2
- ---
- Tying to calculate the sum of days from two date time inputs? HOT 1
- Result filled not the same as in console. HOT 1
- Date manipulation HOT 1
- Field Mode Read Only doesn't show an input field
- Decimal parseInt
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 directus-extension-computed-interface.