Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Fix for Issue #262: 'is not focusable' error #263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions vendor/assets/javascripts/jquery_nested_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@
removeFields: function(e) {
var $link = $(e.currentTarget),
assoc = $link.data('association'); // Name of child to be removed

var hiddenField = $link.prev('input[type=hidden]');
hiddenField.val('1');

var field = $link.closest('.fields');
field.hide();

field.find('*').removeAttr('required');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use $('[required]', event.field).removeAttr('required');.


field
.trigger({ type: 'nested:fieldRemoved', field: field })
.trigger({ type: 'nested:fieldRemoved:' + assoc, field: field });
Expand Down