-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add options for select field. #2683
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've read through this
There are some merge conflicts on the application.js and application.js.map files. I'm a bit new to |
We're going to try updating the builds in each commit/original PR to make things a bit easier, so they'll likely clash now. You can do something like:
to get new versions and not worry about the conflicts. |
Introduced a 'selected' option in the Select field to specify a default value when no data is available. Updated the form partial to prioritize 'selected' over data and added related test cases to ensure correct behavior. Updated .gitignore and added .tool-versions for environment settings. Add max_items, selected, multiple and include_blank. Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
I rebased this to see if I could move it along, but it needs a bit more work.
|
Thanks for the rebase. I'll look into it when i find the time. Kinda working on my side project (Kamal 2, Rails 8) it does include administrate so i'll look into what i think needs love to reach the new rails standards :D. I do expect time to be limited as i'm awaiting the birth of my firstborn, which is bound to happen 1 or 2 months. |
No worries! And of course, completed expected. I was hoping to get the last bit over the line for you, but I'll leave you to it! |
most people won't use this.
Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
…ild:css Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
So i guess some of this does not work < 7. afaik this does not introduce breaking changes though. Am i right to state that:
Anything else? |
I think that's it! |
This PR is a followup of: #2676
I've had another go at this. Since i figured out how to get the application up and running locally, #rtfm. I'm pretty bad at writing tests so perhaps someone can help me with writing some better coverage. Is it sufficient to write a test that validates whether a data attribute is slapped onto the select input? Or do i also need to write tests that validate the working of my PR clientside(the stimulus controller) I have no experience testing stimuluscontrollers.
This should get us a nice start to get some more selectize functionality.
I've used the SelectController Stimulus Controller to handle this. We are using data attributes to get the message passed across.
This PR now adds:
Max items. Allows for selecting items up to max_items.
Multiple selecting multiple options.
Selected, allows for the selection of a specific element or multiple elements.
This also works with [[1, 2],[3,4],[5,6]]