Skip to content

Support prefix and suffix row-level parameters when using a 'select' element in a form - #1549

Merged
lovasoa merged 4 commits into
sqlpage:mainfrom
francesco-cattoglio:prefix-suffix-select-forms
Oct 13, 2026
Merged

lovasoa merged 4 commits into
sqlpage:mainfrom
francesco-cattoglio:prefix-suffix-select-forms

Conversation

@francesco-cattoglio

Copy link
Copy Markdown
Contributor

Pretty basic change: I needed a select dropdown menu with a prefix instead of a label (for alignment reasons) and I found out that the 'prefix' row-level parameter was ignored.
I copied the necessary code from the input type of control over to the select one, and fixed the indentation.
Tested locally, everything seems to work allright.

Added support for prefix text, prefix icon and suffix text to form component when 'select' is the field type
@lovasoa

lovasoa commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Great thank you ! Can you add a small test to prevent regressions ?

@francesco-cattoglio

Copy link
Copy Markdown
Contributor Author

Will try to add one and report back soon!

@francesco-cattoglio

Copy link
Copy Markdown
Contributor Author

I added a test in the tests/sql_test_files/component_rendering folder. I ran cargo test --all-features, it correctly fails on the base branch, it passes with my changes. As you can see I only tested the 'prefix', not the suffix nor the prefix_icon, but I think this is enough.
I added an extra change to the form docs: in the 'select' example I added a cherry as prefix-icon on the 'select the fruit' (example 6), if you want to keep it, it might count as an extra test 😄

@lovasoa
lovasoa added this pull request to the merge queue Oct 13, 2026
@lovasoa

lovasoa commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

thank you very much, the fix is in :)

@francesco-cattoglio

Copy link
Copy Markdown
Contributor Author

I just realised I added the 'cherry' as prefix_icon in the wrong part of the documentation, it will only appear in the section "In SQLite, the query would look like", it will not be part of the rendered SQL. Oh well, at least the user will know that the prefix can be used 😅

Merged via the queue into sqlpage:main with commit 452bd77 Oct 13, 2026
52 checks passed
@francesco-cattoglio
francesco-cattoglio deleted the prefix-suffix-select-forms branch October 13, 2026 13:35
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.

2 participants