getkirby / ideas

This is the backlog of ideas and feature requests from the last two years. Use our new feedback platform to post your new ideas or vote on existing ideas.
https://feedback.getkirby.com
20 stars 0 forks source link

Add asterisk to required input fields automatically #369

Closed GiantCrocodile closed 5 years ago

GiantCrocodile commented 5 years ago

We had some issues in Kirby 3 related to the fact that input fields were marked with an * as required but indeed they weren't required. The * shouldn't be placed by hand but automatically and thus easily shows when a required field was intended but technically forgotten to be properly defined.

This should be a tiny feature and it reduces the manual maintain effort and provides a common way of visual representation of required fields.

bastianallgeier commented 5 years ago

Was the page still in draft mode? Validations don't throw an error when the page is still in draft mode unless you try to publish it. This is intended behaviour because you might want to fill in missing information later and still save a page when it's a draft.

GiantCrocodile commented 5 years ago

Hi @bastianallgeier! I mean cases like here:

In those cases there were a * but it wasn't validated. I just checked the content creation part (blueprints): They do indeed add an * automatically. So maybe this should just be extended to Kirby 3s input fields, regardless if it's blueprints based.

distantnative commented 5 years ago

@GiantCrocodile I don't quite understand your argument beyond the bugs that have been fixed. What would you suggest to do different than it is now? Thanks.

GiantCrocodile commented 5 years ago

@distantnative The problem is that the asterisks are not tied to a functional validation: The field can be required or non-required, independent from an * being shown. This should be closely tied to each other and automatically done to prevent human mistakes leading to bugs or usability issues.

distantnative commented 5 years ago

@GiantCrocodile I’m not sure I get your thought: whenever a * is shown, the field should be required and validated accordingly. Is this not happening somewhere then that is a bug and should be reported in the issues repository. At the same time developers shouldn’t be able To add an asterisk somewhere without making the field required at the same time. If Kirby allows the opposite, that is a bug and should be reported.

I don’t see the idea part of this issue to be honest. Are there occasions where Kirby still acts differently (I know there were bugs in the past but those have been fixed - did you find new ones?)?

texnixe commented 5 years ago

As far as I can see, the asterisk is always added depending on the condition that the field is required:

<abbr v-if="required" title="This field is required">*</abbr>

On a side note, shouldn't the title be translatable instead of hard-coded?

distantnative commented 5 years ago

@texnixe side note: it should, yes

bastianallgeier commented 5 years ago

I've fixed the hard-coded translation. I will close this ticket for now. Please open specific issues for each field where the validation is not working as expected.

GiantCrocodile commented 5 years ago

@distantnative The point here seems to be that I wasn't aware that the asterisks aren't hard coded in some cases but totally dynamic. I thought that there is no bug possible which breaks this feature just partially. Thanks for your explanation! My idea was based on a wrong understanding of the cause of the reported bugs and thus became invalid.