neos-ui
neos-ui copied to clipboard
Add allowEmpty option to RangeSlider
Currently, the range slider can not be empty. We should ad this option
Styling is hard:

or

or

Personally, I think option three is the best
BTW, this works only properly if the type of the property is a string, otherwise, it will set it the value to 0
.
is this range editor the first editor with type int|null
? - i guess currently a none value is casted to 0 right?
i think this fat 'X' button is (always) quite massive - and i see many editors applying them. Can there be maybe a more subtle way? Lightroom (adobe) handles this by displaying an option 'reset' above each control group when holding alt/option... but that may be overkill for editors.
how about double clicking the blue slide handle (but that should probably be reserved for resetting to defaultValue
)
Maybe we can add an empty button and reset to default button like this - or similar
Why should it be empty if min and max are always required / have defaults?
Should we close this?
IMO it doesn't make so much sense to have required min/max values and defaults and then allow null
Yep, let's close this
@grebaldi i just remembered this one while testing https://github.com/neos/neos-ui/pull/3535 - as its now possible to set integer types to null via the ui, should we allow it also for the range editor?
My general thought is that unless you have a property with an notemptyvalidator its ALWAYS legal to set the property to null. And thus it should also be doable via the ui.
I think we need to approach this entire problem differently.
It's a bit awkward imho that we rely on the presence of some Neos.Neos/Validation/NotEmptyValidator
to figure out whether a property is mandatory or optional. In fact, we don't really ever know whether a property is mandatory or optional.
I think nullability should be part of the NodeType Schema, either through type description
properties:
myOptionalIntegerProperty:
type: ?integer
or through flag
properties:
myOptionalIntegerProperty:
type: integer
required: false # or `optional: true`
This should imply the presence of Neos.Neos/Validation/NotEmptyValidator
, while it also allows the editor implementation to make decisions based on the nullability of the given property type.
This doesn't solve the particular design problem here, but at least it would give us a basis to decide whether or not to show a "clear"- or "reset"-button.
@grebaldi exactly what @bwaidelich and me have in mind ;) https://github.com/neos/neos-development-collection/issues/4304#issuecomment-1578965994 the validators are dirt ^^
the required
flag could also replace the allowEmpty
flag for selectboxes