Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pre-filling of free text inputs #203

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

dringoen
Copy link
Contributor

This change allows free text to be re-displayed just like an id-based value from the options will be re-displayed. This allows the form to be re-painted for search applications as well as re-displaying forms after validation errors that would create a new entry.

It covers the case where the free text is returned in the same field as selected-option values. I'm not sure I see anything in the design that allows pre-filling of fields named via name_when_new, which seems fine.

I have an application for this where a search result is based on either an option selection, or a full-text search based on a free text entry, and want to be able to re-draw the form with the same text displayed.

Thanks for an inspiring and useful gem!

This change allows free text to be re-displayed just like an id-based value from the options will be re-displayed. This allows the form to be re-painted for search applications as well as re-displaying forms after validation errors that would create a new entry.
Copy link
Owner

@josefarias josefarias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dringoen really appreciate you identifying the issue, coming up with a fix, and mentioning a use case in the description.

This is spectacular work. Thank you for your time on this!

@josefarias josefarias merged commit b07617e into josefarias:main Aug 31, 2024
2 checks passed
@josefarias josefarias added the bug Something isn't working label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants