Add Shorthand for Error Messages in flux:input #825
Replies: 3 comments 1 reply
-
@amr-coding A This is described in the docs: https://fluxui.dev/components/field#shorthand-props If you try:
you will see If there is no |
Beta Was this translation helpful? Give feedback.
-
@amr-coding Exactly. That is why, when there is no label or description for an input (which is a good indicator of a minimalistic form design) Flux leaves it up to the programmer to display any validation errors in a way that would provide the necessary information without breaking the layout, e.g. a bulleted list at the top or bottom of the form. |
Beta Was this translation helpful? Give feedback.
-
I was the one asking the question ;)
This is a very good point.
This is maybe a documentation problem (or maybe its just me), since I was thinking, that it doesn't work at all, since I only tried it without a label. @amr-coding |
Beta Was this translation helpful? Give feedback.
-
Background:
I was exploring the Flux documentation and community on Discord, where I encountered a question in the Flux channel about the verbosity of handling error messages for inputs. The user was looking for a simpler way to manage validation errors without needing to explicitly define an error component for each input field within the
flux:field
, as shown:This setup seemed unnecessarily verbose, particularly for forms with many fields. Motivated by this, I decided to experiment with the Flux components to see if I could implement a more elegant solution.
Description:
I propose adding an attribute, like errorable, to the flux:input component to automatically show validation errors when they occur that also works with
flux:field
.This would simplify the current implementation to:
errorable1.mp4
(I've adjusted some code in a published Flux file to make this work, but I'm unsure if it's permissible to share that here.)
Benefits:
Simplification: Reduces the amount of code needed to handle forms with many fields.
Beta Was this translation helpful? Give feedback.
All reactions