-
Notifications
You must be signed in to change notification settings - Fork 0
Input field container options #65
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
Conversation
This paves the way for future enhancements, such as not adding the class attributes unless it has any classes to add.
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.
Pull request overview
This PR fixes a bug in the Flowbite::InputField component where HTML attributes passed via the options parameter were not being applied to the container element. This restores the ability to add id attributes or connect Stimulus controllers to the input field container.
Changes:
- Added
container_optionsmethod to mergeoptionswith computed classes - Updated template to use
content_tagwithcontainer_optionsinstead of static div with only class attributes - Added test to verify data attributes can be passed to the container element
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/components/flowbite/input_field.rb | Adds container_options method that merges the @options hash with computed CSS classes |
| app/components/flowbite/input_field/input_field.html.erb | Changes from static div with class attribute to content_tag that accepts all HTML options |
| test/components/flowbite/input_field_test.rb | Adds test verifying that data attributes can be passed via options parameter |
| CHANGELOG.md | Documents the bug fix in the Fixed section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Correctly add options to the container element, so you can add id attributes or connect Stimulus controllers again.