Skip to content

Commit

Permalink
Added createOnBlur data attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored Feb 23, 2024
1 parent 0892cee commit 0e63cfd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function initFormControls()
searchField: ['text'],
labelField: 'text',
valueField: 'id',
create: el.dataset['tags'] !== undefined,
create: 'tags' in el.dataset,
createOnBlur: 'createOnBlur' in el.dataset,
allowEmptyOption: true,
addPrecedence: true,
optgroupLabelField: 'group',
Expand Down Expand Up @@ -59,7 +60,7 @@ function initFormControls()
options.plugins.push('remove_button');
}

if (el.dataset['ajax-Url'] !== undefined) {
if ('ajax-Url' in el.dataset) {
options.plugins.push('virtual_scroll');
options.sortField = [{field:'$order'},{field:'$score'}];
options.searchField = [];
Expand Down

0 comments on commit 0e63cfd

Please sign in to comment.