Skip to content

Conversation

lukebennett
Copy link

This is a somewhat speculative PR as it involves a potentially breaking change. I need more customisation of the signup page - at the moment it's possible to add additional fields, but they show after a set of hardcoded fields (name, email, password, confirmPassword). Whilst this will be fine in many cases, I have separate firstName and lastName fields and I wanted them to show before the email and password fields, and there didn't seem to be a way to do this.

This PR will order the fields based on the contents of signUpFields; if any of the required fields are not specified, they'll be added in subject to the existing business logic (nameRequired etc). There's also a special case handling signUpFields being set to ["name"] i.e. the default, with a view to making it as backwards-compatible as possible.

As a result, the only way somebody should be impacted by this is if they are currently including one or more of the required fields in their signUpFields property e.g. a value of ["foo", "bar", "email", "password"] would result in their field order unexpectedly changing from name, email, password, foo, bar to name, foo, bar, email, password. This feels like quite an edge case but is important to note.

Would welcome thoughts and suggestions!

@lukebennett lukebennett force-pushed the feat/orderable-signup-fields branch from c2f5dee to 74ade66 Compare May 31, 2025 19:21
@lukebennett lukebennett force-pushed the feat/orderable-signup-fields branch from 74ade66 to dfbb5ae Compare May 31, 2025 19:29
@daveycodez
Copy link
Contributor

Hey I've got a large pending PR waiting for 1.2.9 that has breaking changes with this setup, so you might need to update it once v2.0.0 goes out. Just a heads up. Bekacru said 1.2.9 should be coming out soon

@lukebennett
Copy link
Author

Thanks for the heads up. In that case I'm going to add another change in here that's also in the same file, rather than try and juggle two refactors. It adds support for select fields to the signup form.

Will keep an eye out for 1.2.9 dropping and refactor accordingly.

@daveycodez
Copy link
Contributor

I can merge this once it gets migrated to merge without conflicts >2.0

@masonyekta
Copy link

Great work on this @lukebennett! Any chance you can fix the merge conflict since version 2 is released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants