andrewdwallo / erpsaas

A Laravel and Filament-powered accounting platform, crafting a modern and automated solution for financial management.
MIT License
851 stars 241 forks source link

Make Fields for Custom Names hidden until user select "Other". Add pr… #41

Closed Hussam92 closed 7 months ago

Hussam92 commented 8 months ago

Make Invoice Fields for Custom Names hidden until user select "Other". Add prefix to further indicate what the "newly popped up field" is meant for

andrewdwallo commented 7 months ago

Hey sorry for just getting to this. Thank you for your contribution and the effort you’ve put into this PR. I’ve decided to continue using a disabled field rather than hiding it for a few key reasons:

  1. Visual Consistency: Keeping the field visible but disabled maintains the layout, helping users understand what information may be required without experiencing unexpected shifts in the form and especially its container (the section layout).
  2. Guidance and Accessibility: A visible but disabled field guides users by setting clear expectations about possible future inputs and ensures better accessibility, as sudden changes can be confusing, particularly for those using assistive technologies.

Additionally, I have concerns regarding the visual and functional consistency between related fields. In the suggested changes, for example, the item_name.custom field becomes visible with a prefix instead of a label above, which differs from the item_name.option field. This inconsistency can imply that they are separate fields, even though they are technically extensions of each other for the "other" option. Maintaining a uniform label presentation across related fields helps reinforce their interconnectedness and prevents confusion, so it would be better for both fields to have the same label while presenting the fact that one of them is just an extension of the other.

While I appreciate the intention behind hiding the field to streamline the interface, I believe keeping it disabled until needed offers a more intuitive and user-friendly approach. I’m open to further discussions on this or other enhancements you might consider, such as ways to more clearly indicate when a disabled field becomes enabled after the user selects the "other" option.