Skip to content
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

combine_options! overrides custom-set HTML classes with default values of that component (html_class) #158

Open
tmaier opened this issue Dec 9, 2023 · 0 comments

Comments

@tmaier
Copy link
Contributor

tmaier commented Dec 9, 2023

      def combine_options!
        @options = (self.class.default_options.deep_dup || {}).deep_merge(options).tap do |opts|
          opts[:class] = class_names(options[:class], html_class) if (html_class || options[:class]).present?
        end
      end

should be

      def combine_options!
        @options = (self.class.default_options.deep_dup || {}).deep_merge(options).tap do |opts|
          opts[:class] = class_names(html_class, options[:class]) if (html_class || options[:class]).present?
        end
      end

else, one will never be able to override defaults with the classes given via option

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

No branches or pull requests

1 participant