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

Tabbing in nested forms not working properly. #3279

Open
alecslupu opened this issue May 18, 2020 · 0 comments
Open

Tabbing in nested forms not working properly. #3279

alecslupu opened this issue May 18, 2020 · 0 comments

Comments

@alecslupu
Copy link

alecslupu commented May 18, 2020

I am using RailsAdmin 2.0.2, RailsAdminGlobalizeField 1.2.0, and Globalize3 gems.
Having the models set up like:

class Poll < ApplicationRecord
  has_many :poll_options, dependent: :destroy
  accepts_nested_attributes_for :translations, allow_destroy: true
end
class PollOption < ApplicationRecord
  translates :description, touch: true, versioning: :paper_trail
  accepts_nested_attributes_for :translations, allow_destroy: true
end

And the following Rails admin setup

  config.model "Poll" do
    parent "Post"
    edit do
     fields :poll_options
    end 
  end 

  config.model "PollOption" do
    configure :translations, :globalize_tabs
    nested do
      exclude_fields :translations
    end
  end

  config.model 'PollOption::Translation' do
    include_fields :locale, :description
  end

I get some some strange behavior regarding the tabbing when trying to add multiple Poll Option entries. The tabbing is activated on model level (meaning i can browse through the Poll Option forms), however, the translations (which are also tabbed are not working). when clicking on on the language, the selected tab becomes active, but the tab-pane is not being changed.

I get the same behavior when trying to edit a poll that has 2 options. The tab-panes in the second object is not correctly activated.

An addition ticket has been opened in rails_admin_globalize_field, however, i could reproduce the same behavior in my own fom / field implementation.

image

The object having id #144, has the following content (all panes activated from firebug for demo purpose)
image

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