Skip to content

Commit

Permalink
fix: await getValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Oct 16, 2023
1 parent f3e5904 commit 2d6cefa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const CoCreateEvents = {
}
},

__updateElements: function (element, prefix, target) {
__updateElements: async function (element, prefix, target) {
const self = this;
// TODO: support empty value when prefix-attribute defined, add and remove the attribute

Expand All @@ -229,7 +229,7 @@ const CoCreateEvents = {
if (values)
values = values.split(',');
else {
values = element.getValue()
values = await element.getValue()
if (!Array.isArray(values))
values = [values]
}
Expand Down Expand Up @@ -279,7 +279,7 @@ const CoCreateEvents = {

},

setValue: function (prefix, element, attrName, values, key, deactivate) {
setValue: async function (prefix, element, attrName, values, key, deactivate) {
let attrValues, oldValue;
if (key) {
key = `{{${key}}}`;
Expand Down Expand Up @@ -310,7 +310,7 @@ const CoCreateEvents = {
}
} else {
if (attrName === 'value') {
oldValue = element.getValue()
oldValue = await element.getValue()
} else if (attrName === 'text') {
attrValues = element.getAttribute(attrName).split(' ').map(x => x.trim());
oldValue = values.filter(x => attrValues.includes(x))[0] || '';
Expand Down

0 comments on commit 2d6cefa

Please sign in to comment.