Skip to content

Conversation

@koppen
Copy link
Member

@koppen koppen commented Jan 17, 2026

Correctly add options to the container element, so you can add id attributes or connect Stimulus controllers again.

This paves the way for future enhancements, such as not adding the class
attributes unless it has any classes to add.
Copy link
Contributor

Copilot AI left a 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_options method to merge options with computed classes
  • Updated template to use content_tag with container_options instead 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.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@koppen koppen merged commit 5f01fa6 into main Jan 17, 2026
17 checks passed
@koppen koppen deleted the input_field_container_options branch January 17, 2026 18:20
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