-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make BaseComponent & FieldComponent extendable #69
Comments
I suggest to remove Also for generic config, I think we may have a method like |
After discussion, here is what we will do:
class MyCustomBuilder
def component_html_options(component, options)
if component.is_a?(Form::SelectComponent)
options[:class] += " my-custom-form-field"
end
options
end
end module Form
class SelectComponent < ViewComponent::Form::SelectComponent
def options(options)
{ include_blank: true }.merge(options)
end
def html_options(html_options)
html_options.tap do |options|
options[:class] += " my-custom-class"
end
end
end
end |
This issue became relevant for me just now. My component classes all inherit from their I wonder if what we really need here is to be able to create a new class that inherits from |
We have already thought of this way, but if we allow that, then I think we will not be able to have more than one builder per app. |
I think it might be linked to #80 - depending on where the lookup is defined (at the |
Continued from #21
How can we customize
BaseComponent
andFieldComponent
?The text was updated successfully, but these errors were encountered: