Reset language select after adding a language
It worked differently after upgrading to jQuery 3. According to the
jQuery upgrade guide:
> It is almost always a mistake to use .removeAttr("checked") on a DOM
> element. The only time it might be useful is if the DOM is later going
> to be serialized back to an HTML string. In all other cases,
> .prop("checked", false) should be used instead.
This commit is contained in:
committed by
Senén Rodero Rodríguez
parent
f4916a981a
commit
996062fa19
@@ -7,7 +7,7 @@
|
||||
display_locale: function(locale) {
|
||||
App.Globalize.enable_locale(locale);
|
||||
App.Globalize.add_language(locale);
|
||||
$(".js-add-language option:selected").removeAttr("selected");
|
||||
$(".js-add-language option:selected").prop("selected", false);
|
||||
},
|
||||
display_translations: function(locale) {
|
||||
$(".js-select-language option[value=" + locale + "]").prop("selected", true);
|
||||
|
||||
@@ -493,6 +493,7 @@ describe "Admin edit translatable records" do
|
||||
select "Français", from: :add_language
|
||||
|
||||
expect_to_have_language_selected "Français"
|
||||
expect(page).to have_select :add_language, selected: "Add language"
|
||||
expect(page).to have_field "contents_content_#{content.key}values_value_fr"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user