Add required property to SHKPicker and submission validation/cancellation hook
B
Bassem Tourky
Problem
SHKTitle, SHKTextInput, and SHKEmail all support a required: Bool parameter that prevents submission when the field is empty. However, SHKPicker has no equivalent — it always auto-selects the first item and the user can submit without making an active choice.
This makes it impossible to enforce that the user deliberately selects a feedback category (e.g., Bug, Content issue, Voucher issue) before submitting. For teams that triage tickets by picker tags, unintentional default selections create noise and slow down routing.
Requested changes
- required on SHKPicker — When required: true and no explicit selection has been made by the user, block submission the same way empty SHKTitle/SHKTextInput fields are blocked. Optionally support an unselected/placeholder initial state (e.g., initialValue: nil or a dedicated placeholder parameter).
- Submission validation hook — A callback like shakeWillSubmitListener that returns a Bool (or receives a completion handler) allowing the host app to validate form data and cancel submission. The current shakeSubmitListener is fire-and-forget and cannot prevent a ticket from being created.
Use case
We use a custom form with a SHKPicker for feedback type categorization. Tickets are auto-routed by the picker's tag value. Without a required picker or a validation hook, users frequently submit with the default first item selected, causing mis-routed tickets that require manual re-triage.
Log In